JingsongLi commented on code in PR #1014:
URL: https://github.com/apache/paimon-rust/pull/1014#discussion_r4202949771


##########
crates/paimon/src/io/file_io.rs:
##########
@@ -600,14 +658,17 @@ impl FileIO {
     ///
     /// References: 
<https://github.com/apache/paimon/blob/release-0.8.2/paimon-common/src/main/java/org/apache/paimon/fs/FileIO.java#L128>
     pub async fn exists(&self, path: &str) -> Result<bool> {
-        let (op, relative_path) = self.create(path).await?;
+        let (op, relative_path) = self.create_routed(path).await?;
 
-        op.exists(relative_path.as_ref()).await.map_err(|error| {
-            Error::from_opendal_with_context(
-                error,
-                format!("Failed to check existence of '{path}'"),
-            )
-        })
+        op.operator(OpClass::Meta)

Review Comment:
   [P1] Keep recovery validation on origin
   
   `TableCommit::check_recovery_entries` uses this method to check prepared 
files before replaying a commit whose identity has expired. With 
`io-cache.policy=meta,read`, that writer safety check now uses the target. 
Deletes go only to origin, so a cache can still return a positive HEAD after 
cleanup. I reproduced: writer A commits identifier 7; B truncates; snapshot 1 
is expired and A's data file is deleted from origin; the cache retains the old 
object/status; replaying A returns `Ok(())` and publishes snapshot 3 
referencing the absent origin file. There is no subsequent origin existence 
check. This can turn a recovery into a broken committed table. Please use the 
origin-only FileIO for recovery existence validation (both recovery APIs), and 
add a stale-positive-cache regression. In the same probe, changing this safety 
check to `origin_only().exists` rejects the replay and leaves snapshot 2 
current.



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