-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Store Pending Deletions Fix #40345
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
Store Pending Deletions Fix #40345
Conversation
FilterDirectory.getPendingDeletions does not delegate, fixed temporarily by overriding in StoreDirectory. This in turn caused duplicate file name use after a trimUnsafeCommits had been done, since a new IndexWriter would not consider the pending deletes in IndexFileDeleter. This should only happen on windows (AFAIK). Reenabled doing index updates for all tests using IndexShardTests.indexOnReplicaWithGaps (which could fail due to above when using mocked WindowsFS).
|
Pinging @elastic/es-distributed |
ywelsch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch! LGTM
|
@henningandersen I also dug into a recent test failure of testRestoreLocalHistoryFromTranslogOnPromotion (https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+multijob-unix-compatibility/os=centos-6/312/console). I think that test failure has the same cause as the one you are fixing here. I proposed https://issues.apache.org/jira/browse/LUCENE-8734 to record nextWriteDVGen. |
|
@elasticmachine run elasticsearch-ci/packaging-sample |
| public Set<String> getPendingDeletions() throws IOException { | ||
| // FilterDirectory.getPendingDeletions does not delegate, working around it here. | ||
| // to be removed once fixed in FilterDirectory. | ||
| return unwrap(this).getPendingDeletions(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this fix is trappy, but I am ok with it for now. I would like us to delegate all our subclasses of FilterDirectory as well. We have a few more. I am torn on the unwrap to be honest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with that route is that most of the subclasses of this are in lucene, including the MockDirectoryWrapper created by LuceneTestCase and for instance HardlinkCopyDirectoryWrapper used by StoreRecovery.
I agree that using unwrap is questionable, but in the given context this should be safe here until fixed in lucene.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, we should still pro-actively implement the right fix in all subclasses and remove the unwrap once lucene is upgraded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@elasticmachine run elasticsearch-ci/packaging-sample |
1 similar comment
|
@elasticmachine run elasticsearch-ci/packaging-sample |
dnhatn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great find!
Added getPendingDeletions delegation to all elasticsearch FilterDirectory subclasses that were not trivial test-only overrides to minimize the risk of hitting this issue in another case.
FilterDirectory.getPendingDeletions does not delegate, fixed temporarily by overriding in StoreDirectory. This in turn caused duplicate file name use after a trimUnsafeCommits had been done, since a new IndexWriter would not consider the pending deletes in IndexFileDeleter. This should only happen on windows (AFAIK). Reenabled doing index updates for all tests using IndexShardTests.indexOnReplicaWithGaps (which could fail due to above when using mocked WindowsFS). Added getPendingDeletions delegation to all elasticsearch FilterDirectory subclasses that were not trivial test-only overrides to minimize the risk of hitting this issue in another case.
FilterDirectory.getPendingDeletions does not delegate, fixed temporarily by overriding in StoreDirectory. This in turn caused duplicate file name use after a trimUnsafeCommits had been done, since a new IndexWriter would not consider the pending deletes in IndexFileDeleter. This should only happen on windows (AFAIK). Reenabled doing index updates for all tests using IndexShardTests.indexOnReplicaWithGaps (which could fail due to above when using mocked WindowsFS). Added getPendingDeletions delegation to all elasticsearch FilterDirectory subclasses that were not trivial test-only overrides to minimize the risk of hitting this issue in another case.
FilterDirectory.getPendingDeletions does not delegate, fixed temporarily by overriding in StoreDirectory. This in turn caused duplicate file name use after a trimUnsafeCommits had been done, since a new IndexWriter would not consider the pending deletes in IndexFileDeleter. This should only happen on windows (AFAIK). Reenabled doing index updates for all tests using IndexShardTests.indexOnReplicaWithGaps (which could fail due to above when using mocked WindowsFS). Added getPendingDeletions delegation to all elasticsearch FilterDirectory subclasses that were not trivial test-only overrides to minimize the risk of hitting this issue in another case.
Added missing file/commit.
The recent upgrade to lucene 8.1.0 included the fix for LUCENE-8735 (pending deletions did not delegate). Removed the temporary workaround for this. Follow up to elastic#40345
The recent upgrade to lucene 8.1.0 included the fix for LUCENE-8735 (pending deletions did not delegate). Removed the temporary workaround that was previously added for this issue. Follow up to #40345
The recent upgrade to lucene 8.1.0 included the fix for LUCENE-8735 (pending deletions did not delegate). Removed the temporary workaround that was previously added for this issue. Follow up to elastic#40345
FilterDirectory.getPendingDeletions does not delegate, fixed
temporarily by overriding in StoreDirectory.
This in turn caused duplicate file name use after a trimUnsafeCommits
had been done, since a new IndexWriter would not consider the pending
deletes in IndexFileDeleter. This should only happen on windows (AFAIK).
Reenabled doing index updates for all tests using
IndexShardTests.indexOnReplicaWithGaps (which could fail due to above
when using mocked WindowsFS).
Follow-up to #40249
A follow-up should fix this in FilterDirectory.