devmadhuu commented on PR #5252: URL: https://github.com/apache/ozone/pull/5252#issuecomment-1711190423
> I don't understand how this patch is solving the issue. Because to me, nothing is changing. Instead of using cache iterator, you are just directly getting value form cache. Just to do a simple check, I ran the test 25 times, [with](https://github.com/hemantk-12/ozone/actions/runs/6114711447) and [without](https://github.com/hemantk-12/ozone/actions/runs/6114715767) fix and it passed all the time. > > It would be great if you can add more details how this change will fix it. This test case fails in `checkPath` method of `TestOzoneFSWithObjectStoreCreate.testObjectStoreCreateWithO3fs` test case where even after deleting a key on a given path , `getFileStatus` API returns valid fileStatus, so after analyzing the code flow for getFIleStatus, it was found that `isKeyDeleted` method is the problem where after getting cache iterator on table, cache flush is unpredictably be flushed and can give wrong result check of key deletion. Here in. this test case, we are doing some rename operation and after that all original set of key paths were sent in batch and each key path by key path , code flow hits `createFakeDirIfShould` and check for existence of key here below: ``` if (exists && cacheKey.startsWith(targetKey) && !Objects.equals(cacheKey, targetKey)) { LOG.debug("Fake dir {} required for {}", targetKey, cacheKey); return createDirectoryKey(cacheValue.getCacheValue(), dirKey); } ``` Now here for a given key, control is returning from here in if check and after iterating all keys in batch, if a key not found in cache , we don't want to loose deleted keys entry here because after this while if we don't find the keys in cache, we iterate in keyTable and during this iteration we want to make sure that we don't use `isKeyDeleted` method for key existence in cache due to unpredictable nature of cache flush. So we are making list of deleted keys as well in while loop.. Here is the failed [CI link](https://github.com/devmadhuu/ozone/actions/runs/6098098054/job/16547281063) before the patch and [green CI run](https://github.com/devmadhuu/ozone/actions/runs/6099087358) after applying this patch. -- 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]
