Open gp1314 opened 2 months ago
Automated checks report:
git -c user.name="Name" -c user.email="Email" commit --amend --reset-author
See this answer for more details about how to change commit email addresses. Once the author email address has been updated, update the pull request by running:
git push --force https://github.com/gp1314/alluxio.git dev/gup/failed_delete_empty_directory
Some checks failed. Please fix the reported issues and reply
alluxio-bot, check this please
to re-run checks.
alluxio-bot, check this please
Automated checks report:
Some checks failed. Please fix the reported issues and reply
alluxio-bot, check this please
to re-run checks.
Automated checks report:
Some checks failed. Please fix the reported issues and reply
alluxio-bot, check this please
to re-run checks.
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.
@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
@Test public void evictInodeForTestHasChildren() throws Exception { MutableInodeDirectory myTestdir = MutableInodeDirectory.create(500, 0, "guptest", CreateDirectoryContext.defaults()); mStore.writeNewInode(myTestdir); mStore.mListingCache.evictForTesting(); mStore.mListingCache.evictForTesting(); mStore.mEdgeCache.flush(); mStore.mInodeCache.flush();
}
alluxio.master.metastore.inode.cache.max.size=1024 alluxio.master.metastore.inode.cache.evict.batch.size=100