Shard synchronization behaviour

I'm learning how ES works, reading the Elasticsearch Reference and experimenting its main features. What I did not find in the guide and on the web is how ES behaves when it has to synchronize two shard in scenarios where a shard is not aligned with its primary.

Here an example. I have two nodes N_1 and N_2 and, for simplicity, one-shard index, . Let assume I shutdown N_2 for whatever reason and index some documents in N_1 shard. When I reboot N_2 how does ES synchronize the replica shard in N_2? Does it transfer only changes (files?, documents?) or the shard at all?

Where I can find more information about that topic (references to source code are valid too)?

Thank you in advance for your help.

until ES 5.x we try to detect if we need to resync and if so we have to transfer the entire shard. In 6.x there will be improvements made to this to only resync deltas if possible (after a long enough period that won't be possible either)

If you want to know more about the 6.x work and how it differs from the current approach, I highly suggest watching the 3rd part of this Elastic{ON} talk: https://www.elastic.co/elasticon/conf/2017/sf/consensus-and-reception-in-elasticsearch

It covers this in details.

1 Like

Thank you very much. I'll watch the talk you've suggested me.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.