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

Acquire write.lock when deleting shard directory #11097

Closed
dakrone opened this issue May 11, 2015 · 0 comments · Fixed by #11127
Closed

Acquire write.lock when deleting shard directory #11097

dakrone opened this issue May 11, 2015 · 0 comments · Fixed by #11127
Assignees

Comments

@dakrone
Copy link
Member

dakrone commented May 11, 2015

We currently protect against multiple deletions by acquiring the Engine's writelock, however, we should also ensure that we acquire the write.lock write lock before deleting a shard to ensure that we are the only node writing to the directory.

This will prevent nodes that shared a filesystem from modifying the shard directory in the event that they cannot communicate, assuming that the shared filesystem's locking semantics work correctly.

@dakrone dakrone self-assigned this May 11, 2015
dakrone added a commit to dakrone/elasticsearch that referenced this issue May 12, 2015
In `NodeEnvironment.deleteShardDirectoryUnderLock`, we will now attempt
to acquire, then release, the `write.lock` file for the Lucene index in
question to ensure that no other `IndexWriter` has the directory open
before deleting the data.

Note that the `write.lock` file must be released before the actual
deletion in order to allow the directory to be deleted.

Fixes elastic#11097
dakrone added a commit to dakrone/elasticsearch that referenced this issue May 12, 2015
In `NodeEnvironment.deleteShardDirectoryUnderLock`, we will now attempt
to acquire, then release, the `write.lock` file for the Lucene index in
question to ensure that no other `IndexWriter` has the directory open
before deleting the data.

Note that the `write.lock` file must be released before the actual
deletion in order to allow the directory to be deleted.

Fixes elastic#11097
dakrone added a commit that referenced this issue May 12, 2015
In `NodeEnvironment.deleteShardDirectoryUnderLock`, we will now attempt
to acquire, then release, the `write.lock` file for the Lucene index in
question to ensure that no other `IndexWriter` has the directory open
before deleting the data.

Note that the `write.lock` file must be released before the actual
deletion in order to allow the directory to be deleted.

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

Successfully merging a pull request may close this issue.

1 participant