Fix failed to delete an empty directory due to cache evict#18675
Fix failed to delete an empty directory due to cache evict#18675gp1314 wants to merge 2 commits intoAlluxio:master-2.xfrom
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. |
| } | ||
|
|
||
| @Test | ||
| public void evictInodeForTestHasChildren() throws Exception { |
There was a problem hiding this comment.
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.hasChildrenreproduction
Why are the changes needed?
Please clarify why the changes are needed. For instance,
CachingInodeStore.hasChildren, can removemBackingStore.hasChildren(inode), becausemListingCache.GetDataFromBackingStorealready from rocksdb checked againDoes this PR introduce any user facing changes?
No changes to the user-facing api