Hi, I have a question regarding shard recovery and translog handling in Elasticsearch.
Let’s say a primary shard goes offline due to a sudden node failure. One of the replica shards is promoted to be the new primary. Later, the previously failed node (which had the original primary shard) comes back and rejoins the cluster.
In this case, I’m curious about whether Elasticsearch uses the translog from the recovered node during shard recovery. What if the translog on the recovered node contains writes that were not replicated to the promoted replica before the failure? Wouldn’t there be a risk of missing or conflicting writes between the promoted primary and the recovered node’s translog?
How does Elasticsearch handle such potential inconsistencies and ensure data safety in this kind of scenario?
Thanks in advance for your help!