Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Lucene merges should run on the target shard during recovery #10463
This is already fixed on 2.0, since we let Lucene launch its own merges again.
But in 1.x, Lucene merges might not run on the target during recovery, causing segment explosion when there are many docs to replay and/or the index buffer is low. This then makes recovery time O(N^2) and can cause issues like #9226.
I just moved launching of the mergeScheduleFuture out of startScheduledTasksIfNeeded (only called once recovery is done) and into createNewEngine. This way whenever the engine is created we also start checking for merges.
I also renamed startScheduledTasksIfNeeded -> startEngineRefresher, and cleaned up a couple unrelated things.