QuakeWang commented on code in PR #195:
URL: https://github.com/apache/paimon-rust/pull/195#discussion_r3031670473


##########
crates/paimon/src/table/snapshot_manager.rs:
##########
@@ -99,15 +154,60 @@ impl SnapshotManager {
                 message: format!("snapshot JSON invalid: {e}"),
                 source: Some(Box::new(e)),
             })?;
-        if snapshot.id() != snapshot_id {
-            return Err(crate::Error::DataInvalid {
-                message: format!(
-                    "snapshot file id mismatch: LATEST points to 
{snapshot_id}, but file contains snapshot id {}",
-                    snapshot.id()
-                ),
-                source: None
-            });
-        }
+        Ok(snapshot)

Review Comment:
   This `get_snapshot()` path now returns the deserialized snapshot directly, 
but it no longer checks `snapshot.id() == snapshot_id`.
   
   That means a mismatched `snapshot-{id}` file will be accepted silently, and 
both the new time-travel path and the normal latest-snapshot path can read the 
wrong snapshot instead of failing fast.
   
   I think we should keep the same id-consistency check here before merging.



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