yunfengzhou-hub commented on code in PR #4215:
URL: https://github.com/apache/paimon/pull/4215#discussion_r1768089714


##########
paimon-core/src/main/java/org/apache/paimon/utils/SnapshotManager.java:
##########
@@ -118,8 +118,20 @@ public Path snapshotDirectory() {
     }
 
     public Snapshot snapshot(long snapshotId) {
-        Path snapshotPath = snapshotPath(snapshotId);
-        return Snapshot.fromPath(fileIO, snapshotPath);
+        try {
+            Path snapshotPath = snapshotPath(snapshotId);
+            return Snapshot.fromPath(fileIO, snapshotPath);
+        } catch (Exception e) {
+            String errorMessage =
+                    String.format(
+                            "Failed to read snapshot file for snapshot %s. "
+                                    + "It might have been expired by other 
jobs operating on this table. "
+                                    + "In this case, you can avoid concurrent 
modification issues by configuring "
+                                    + "write-only = true and use a dedicated 
compaction job, or configuring "
+                                    + "different expiration thresholds for 
different jobs.",
+                            snapshotId);
+            throw new IllegalStateException(errorMessage, e);

Review Comment:
   The FileNotFoundException has already been wrapped with RuntimeException in 
Snapshot#fromPath. I'll modify this method to avoid wrapping 
FileNotFoundException twice.



-- 
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-unsubscr...@paimon.apache.org

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

Reply via email to