What does sync and async replica means?


(Makeyang) #1

when I read the 1.7.0 code of index a document, the execute path is below:
when TransportShardReplicationOperationAction.performOnPrimary is finished,
then execute TransportShardReplicationOperationAction.performOnReplica,
and if the replica shards are on other nodes, the node which performed the primary shard write will use "same" threadpool and new threads for each relica to send the write request to replica node and won't wait for that fininsed before it return success to the client.
so I don't get why it is called sync replica rather than async relica because it doesn't block until the result of relica then return result to client.
in this scenario, what does sync and async means?
what dose async do back to ES 1.4 when it support async replica do?


(Makeyang) #2

when take another look, i found that the final response will wait until the replic response back.
so I guess back to 1.4 when es supoort async replica, the final response won't wait the relic response back.


(system) #3