You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "kaijchen (via GitHub)" <gi...@apache.org> on 2023/02/20 09:23:50 UTC

[GitHub] [ozone] kaijchen commented on a diff in pull request #4287: HDDS-7991. Intermittent failure in FS contract tests

kaijchen commented on code in PR #4287:
URL: https://github.com/apache/ozone/pull/4287#discussion_r1111675074


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java:
##########
@@ -1176,24 +1176,51 @@ private OzoneFileStatus getOzoneFileStatus(OmKeyArgs args,
    */
   private OmKeyInfo createFakeDirIfShould(String volume, String bucket,
       String keyName, BucketLayout layout) throws IOException {
-    OmKeyInfo fakeDirKeyInfo = null;
     String dirKey = OzoneFSUtils.addTrailingSlashIfNeeded(keyName);
     String targetKey = OzoneFSUtils.addTrailingSlashIfNeeded(
         metadataManager.getOzoneKey(volume, bucket, keyName));
+
+    Table<String, OmKeyInfo> keyTable = metadataManager.getKeyTable(layout);
+    Iterator<Map.Entry<CacheKey<String>, CacheValue<OmKeyInfo>>> cacheIterator =
+        keyTable.cacheIterator();
+    while (cacheIterator.hasNext()) {

Review Comment:
   KeyTableCache is `PartialTableCache`, which is implemented by `ConcurrentHashMap`. Will there be a problem If the iterator visits the entries out of order?
   I think it's fine since the exact cache hit should be filtered in https://github.com/apache/ozone/pull/4287#issuecomment-1436492008
   
   



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org