sodonnel commented on a change in pull request #3032:
URL: https://github.com/apache/ozone/pull/3032#discussion_r797454873



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
##########
@@ -934,9 +929,17 @@ public boolean isBucketEmpty(String volume, String bucket)
 
           // Entry should not be marked for delete, consider only those
           // entries.
-          if(!deletedKeySet.contains(kv.getKey())) {
-            cacheKeyMap.put(kv.getKey(), kv.getValue());
-            currentCount++;
+          String key = kv.getKey();
+          try {
+            CacheKey<String> k = new CacheKey<>(key);
+            boolean inCache = keyTable.isKeyInCache(k);
+            CacheValue<OmKeyInfo> omKeyInfoCacheValue =
+                keyTable.getCacheValue(new CacheKey(k));
+            if(!inCache || omKeyInfoCacheValue != null) {

Review comment:
       I think `omKeyInfoCacheValue` is basically the same as `inCache`. It 
will be null if the entry is not in the cache, but I think your intention here 
is to check `omKeyInfoCacheValue.getCacheValue() != null` ?




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