luoyuxia commented on code in PR #2223:
URL: https://github.com/apache/fluss/pull/2223#discussion_r2639843533


##########
fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/tiering/committer/TieringCommitOperator.java:
##########
@@ -323,33 +285,45 @@ private void checkFlussNotMissingLakeSnapshot(
         // known lake snapshot, which means the data already has been 
committed to lake,
         // not to commit to lake to avoid data duplicated
         if (missingCommittedSnapshot != null) {
-            if (missingCommittedSnapshot.getSnapshotProperties() == null
-                    || missingCommittedSnapshot
-                                    .getSnapshotProperties()
-                                    
.get(FLUSS_LAKE_SNAP_BUCKET_OFFSET_PROPERTY)
-                            == null) {
+            String lakeSnapshotOffsetPath =
+                    missingCommittedSnapshot
+                            .getSnapshotProperties()
+                            .get(FLUSS_LAKE_SNAP_BUCKET_OFFSET_PROPERTY);
+
+            // should only will happen in v0.7 which won't put offsets info
+            // to properties
+            if (lakeSnapshotOffsetPath == null) {
                 throw new IllegalStateException(
                         String.format(
-                                "Missing required log offsets property '%s' in 
lake snapshot %d for table: ‘tablePath=%s, tableId=%d’. "
-                                        + "This property is required to commit 
the missing snapshot to Fluss. "
-                                        + "The snapshot may have been created 
by an older version of Fluss that did not store this information, "
-                                        + "or the snapshot properties may be 
corrupted.",
+                                "Can't find %s field from snapshot property.",
+                                FLUSS_LAKE_SNAP_BUCKET_OFFSET_PROPERTY));
+            }
+
+            // the fluss-offsets will be a json string if it's tiered be v0.8,
+            // since the code path should happen rarely, not to consider back 
compatibility
+            // throw IllegalStateException directly
+            String trimmedPath = lakeSnapshotOffsetPath.trim();
+            if (trimmedPath.startsWith("{")) {
+                throw new IllegalStateException(
+                        String.format(
+                                "The %s field in snapshot property is a JSON 
string (tiered by v0.8), "
+                                        + "which is not supported to restore. 
Snapshot ID: %d, Table: {tablePath=%s, tableId=%d}.",
                                 FLUSS_LAKE_SNAP_BUCKET_OFFSET_PROPERTY,
                                 missingCommittedSnapshot.getLakeSnapshotId(),
                                 tablePath,
                                 tableId));
             }

Review Comment:
   the path shouldn't contains '{'



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