smengcl commented on code in PR #5252:
URL: https://github.com/apache/ozone/pull/5252#discussion_r1320385135
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java:
##########
@@ -1228,6 +1229,12 @@ private OmKeyInfo createFakeDirIfShould(String volume,
String bucket,
LOG.debug("Fake dir {} required for {}", targetKey, cacheKey);
return createDirectoryKey(cacheValue.getCacheValue(), dirKey);
}
+ // deletedKeys may contain deleted entry while iterating cache iterator
+ // To avoid race condition of flush of cache while iterating
+ // table iterator.
+ if (!exists) {
+ deletedKeys.add(cacheKey);
+ }
}
Review Comment:
This can be dumping a lot of keyTable cache entries into the temp set
`deletedKeys`. And this method can be called frequently from `getFileStatus` /
`getOzoneFileStatus`.
Is there a better way to fix this?
It might be fine for now since keyTable cache should only hold a few entries
that are not flushed yet.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]