-
Notifications
You must be signed in to change notification settings - Fork 24.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recovery should wipe the shard state file before starting recovery #10053
Comments
@brwe can you take care of this? |
I wonder if the correct time to wipe any _state file is before the temp file rename. Until then, the recovery doesn’t mess with any non-temp files. If the recover is cancelled, we leave the target shard intact.
|
@bleskes agreed.. we should remove it before we rename the first file. |
Just for reference, here is the relevant test failure: http://build-us-00.elasticsearch.org/job/es_core_1x_small/1800/ |
Today we leave the shard state behind even if a recovery is half finished this causes in rare conditions shards to be recovered and promoted as primaries that have never been fully recovered. Closes elastic#10053
When we start recovery of a shard we should wipe the state file of the copy if it's present otherwise gateway allocating can get confused interpreting a shard that is not fully recovered ie. due to a recovery failure as a valid copy since we only write the state when the shard is started.
The text was updated successfully, but these errors were encountered: