JingsongLi commented on code in PR #8263:
URL: https://github.com/apache/paimon/pull/8263#discussion_r3445384460


##########
paimon-core/src/main/java/org/apache/paimon/utils/HintFileUtils.java:
##########
@@ -45,6 +45,11 @@ public static Long findLatest(FileIO fileIO, Path dir, 
String prefix, Function<L
             throws IOException {
         Long snapshotId = readHint(fileIO, LATEST, dir);
         if (snapshotId != null && snapshotId > 0) {
+            // On object stores, probing a missing object can require list 
permission. Trust the
+            // committed hint and let the commit retry path handle a 
concurrently newer snapshot.
+            if (fileIO.isObjectStore()) {
+                return snapshotId;

Review Comment:
   This still falls back to listing when `LATEST` is absent (for example on the 
first commit of a new table, or after the hint file is lost). 
`FileStoreCommitImpl` calls `snapshotManager.latestSnapshot()` before it writes 
`snapshot-1`, so with an S3 user that has `GetObject`/`PutObject` but no 
`ListBucket`, an empty table will fail here before the new conditional PUT path 
is reached. The new object-store test writes `LATEST` first, so it does not 
cover this case. For object stores we need a no-list path for a missing hint as 
well, such as treating the missing hint as no latest snapshot and relying on 
the no-overwrite snapshot write to reject an unexpected existing `snapshot-1`.



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

Reply via email to