-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix failed to delete an empty directory due to cache evict #18675
base: master-2.x
Are you sure you want to change the base?
Fix failed to delete an empty directory due to cache evict #18675
Conversation
Automated checks report:
Some checks failed. Please fix the reported issues and reply |
…tion in CachingInodeStore.
3da3a4a
to
893ea90
Compare
alluxio-bot, check this please |
Automated checks report:
Some checks failed. Please fix the reported issues and reply |
1 similar comment
Automated checks report:
Some checks failed. Please fix the reported issues and reply |
Automated checks report:
All checks passed! |
@jiacheliu3 Could you please help core review it |
That is very interesting finding, thanks a lot @gp1314 ! The logic here is definitely complicated and let me spend some time thinking and get back to you. Right now, I feel the "issue" is because there are many lock-free operations in the CachingInodeStore. So operations on different parts of the internal cache (inode cache, edge cache, listing cache) are not atomic. Your solution is probably correct, but let me think twice about possible alternatives. |
@@ -335,6 +336,27 @@ public void skipCache() throws Exception { | |||
assertEquals(0, mStore.mInodeCache.getCacheMap().size()); | |||
} | |||
|
|||
@Test | |||
public void evictInodeForTestHasChildren() throws Exception { |
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.
thanks for adding this test case! My understanding is, once your code is merged, this test case is no longer needed right? In other words, if your code is merged, assertEquals(false, mStore.hasChildren(myTestdir));
will return false.
@jiacheliu3 Could you please help core review it again |
What changes are proposed in this pull request?
phenomenon
In a production environment I delete empty directory encountered DirectoryNotEmptyException anomalies
I'm sure I deleted the files in the directory first, and then deleted the empty directory
recursive is set to false when an empty directory is deleted
reason
!mListingCache.getDataFromBackingStore(inode.getId(), option).isEmpty()|| mBackingStore.hasChildren(inode);
judgmentCachingInodeStore.hasChildren
reproduction
Why are the changes needed?
Please clarify why the changes are needed. For instance,
CachingInodeStore.hasChildren
, can removemBackingStore.hasChildren(inode)
, becausemListingCache.GetDataFromBackingStore
already from rocksdb checked againDoes this PR introduce any user facing changes?
No changes to the user-facing api