Skip to content
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

[CORE] Wait for pending shard removal on IndexService close #8608

Closed
wants to merge 1 commit into from

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Nov 22, 2014

When an index service gets closed due to a delete index event it's possible
that shards are already removed from the service that are currently in
recovery. The recovery source applies the delete index first and causes
the target to fail its shard. This shard gets removed from the service
but it's content doesn't get deleted if the actual delete index is faster
applied. This commit makes sure we wait for the pending removals that
are in-flight before we close the index an delete it's content too once
the lock is released.

When an index service gets closed due to a delete index event it's possible
that shards are already removed from the service that are currently in
recovery. The recovery source applies the delete index first and causes
the target to fail its shard. This shard gets removed from the service
but it's content doesn't get deleted if the actual delete index is faster
applied. This commit makes sure we wait for the pending removals that
are in-flight before we close the index an delete it's content too once
the lock is released.
@s1monw
Copy link
Contributor Author

s1monw commented Nov 24, 2014

@bleskes if you have time I'd love you to review this - assinging you

@bleskes
Copy link
Contributor

bleskes commented Nov 27, 2014

I looked at it and my main concern is complexity. @s1monw had some ideas about simplifying it and is working on it.

bleskes added a commit to bleskes/elasticsearch that referenced this pull request Dec 19, 2014
elastic#8436 has introduced shard level locks in order to prevent directory reuse during fast deletion & creation of indices. As part for the change, close listeners were introduced to delete the folders once all out standing references were released. The new change has created race conditions causing shard folders not to be deleted (causing test failures due to left over corruption markers). This commit removes the listeners in favor of a simple timeout based solution to be use until a better listener based solution is ready ( elastic#8608 ).
bleskes added a commit to bleskes/elasticsearch that referenced this pull request Dec 19, 2014
elastic#8436 has introduced shard level locks in order to prevent directory reuse during fast deletion & creation of indices. As part for the change, close listeners were introduced to delete the folders once all out standing references were released. The new change has created race conditions causing shard folders not to be deleted (causing test failures due to left over corruption markers). This commit removes the listeners in favour of a simple timeout based solution to be use until a better listener based solution is ready ( elastic#8608 ).

Closes elastic#9009
@s1monw
Copy link
Contributor Author

s1monw commented Dec 29, 2014

closing in favor of #9083

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants