Copilot commented on code in PR #10792:
URL: https://github.com/apache/ozone/pull/10792#discussion_r3641371524


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java:
##########
@@ -690,19 +696,24 @@ public FileStatusAdapter getFileStatus(String path, URI 
uri,
    * Return FileStatusAdapter based on OFSPath being a
    * valid bucket path or valid snapshot path.
    * Throws exception in case of failure.
+   *
+   * <p>Non-snapshot paths call OM GetFileStatus directly (HDDS-15925) without 
a
+   * prior InfoBucket RPC. OBJECT_STORE buckets are not rejected on this path;
+   * mutating OFS operations still validate layout via {@link 
#getBucket(OFSPath, boolean)}.
    */
   private FileStatusAdapter getFileStatusForKeyOrSnapshot(
       OFSPath ofsPath, URI uri, Path qualifiedPath, String userName,
       boolean headOp) throws IOException {
     String key = ofsPath.getKeyName();
     try {
-      OzoneBucket bucket = getBucket(ofsPath, false);
       if (ofsPath.isSnapshotPath()) {
+        OzoneBucket bucket = getBucket(ofsPath, false);
         OzoneVolume volume = objectStore.getVolume(ofsPath.getVolumeName());
         return getFileStatusAdapterWithSnapshotIndicator(
             volume, bucket, uri);
       } else {
-        OzoneFileStatus status = bucket.getFileStatus(key, headOp);
+        OzoneFileStatus status = 
proxy.getOzoneFileStatus(ofsPath.getVolumeName(),
+            ofsPath.getBucketName(), key, headOp);
         return toFileStatusAdapter(status, userName, uri, qualifiedPath,

Review Comment:
   The new non-snapshot path in getFileStatusForKeyOrSnapshot bypasses 
getBucket(...), so it no longer runs link-bucket layout resolution + 
OzoneFSUtils.validateBucketLayout(...). That means getFileStatus can now 
succeed on OBJECT_STORE (and link-to-OBJECT_STORE) buckets even though other 
OFS operations still reject them via getBucket(). This appears to contradict 
the PR description (“OBJECT_STORE rejection” and “link-bucket layout 
validation” unchanged) and also makes OFS behavior inconsistent across 
operations.
   
   Recommendation: please clarify the intended semantics. If getFileStatus 
should continue to reject OBJECT_STORE / invalid link layouts, keep the 
optimization by validating once (eg, validate+cache per (volume,bucket) with 
size/TTL) and only falling back to an InfoBucket lookup on first encounter; 
otherwise update the PR description and add/adjust tests to lock in the new 
relaxed behavior.



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