smengcl commented on code in PR #5051:
URL: https://github.com/apache/ozone/pull/5051#discussion_r1261814990
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -1045,15 +1014,18 @@ private <T> boolean isKeyPresentInTable(String
keyPrefix,
// Case 1: We found an entry, but no cache entry.
if (cacheValue == null) {
// we found at least one key with this prefix.
+ // There is chance cache value flushed when
+ // we iterate through the table.
+ // Check in table whether it is deleted or still present.
+ if (table.getIfExist(kv.getKey()) != null) {
+ // Still in table and no entry in cache
+ return true;
+ }
Review Comment:
Thanks @ashishkumar50 for the patch.
While it looks like the issue is indeed
[mitigated](https://github.com/apache/ozone/blob/e8fbdaaca2a32c67aeb5ba8fbd23bb2a271480f2/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketDeleteRequest.java#L136-L141)
by this extra check, it sounds bizzare to me that the flusher would remove the
cache entry after a disk flush in the first place in `bucketTable` with
`FULL_CACHE` set. And I wonder if there is a potential bug or correctness issue
with the flusher.
https://github.com/apache/ozone/blob/d1ea589314280e6bdc9380bdbb329bb3ba307bb0/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java#L637-L646
IIUC, the whole point of a `FULL_CACHE` table is to keep all entries in
cache. And all DB entries should have been loaded into cache upon OM startup:
https://github.com/apache/ozone/blob/4b9b10f6206ed5c29c0c4957a651de1d24fe86f6/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/TypedTable.java#L110-L125
--
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]