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.