devmadhuu commented on code in PR #5252:
URL: https://github.com/apache/ozone/pull/5252#discussion_r1320529019


##########
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:
   Thanks @smengcl for your review. Another way to fix is this #5093 PR. Here a 
`table.isExist()` API being used, but my only concern is that cache is always 
faster and `isExist` is being called in #5093 PR till we find the target key as 
well it is being called inside `getNextKey() `call. Pls have look #5093 PR



-- 
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]

Reply via email to