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


##########
crates/paimon/src/table/table_commit.rs:
##########
@@ -1423,16 +1423,37 @@ impl TableCommit {
         // Once publication starts its outcome may be unknown. These files must
         // remain available even if the response is lost or a later retry 
fails.
         let base_snapshot_uuid = 
latest_snapshot.as_ref().and_then(Snapshot::uuid);
-        let publication_error = match self
+        let publication = self
             .snapshot_commit
             .commit(
                 base_snapshot_uuid,
                 &snapshot,
                 self.table.branch(),
                 &statistics,
             )
-            .await
-        {
+            .await;
+        // Storage may replay a successful conditional write after losing its
+        // response. Establish ownership before treating false as a rejection.
+        let publication = match publication {
+            Ok(false) => match 
self.snapshot_manager.get_snapshot_uncached(snapshot.id()).await {

Review Comment:
   Rechecked fb4c79eb. The catalog lookup addresses verification when the 
attempted snapshot ID is still current.
   
   A correction to my earlier reasoning: sending the client POST once does not 
make every REST false a definite rejection. The built-in REST server forwards 
SnapshotManager::commit_snapshot's boolean, so server-side conditional-write 
replay can also return false after publication. A different or empty current 
catalog head therefore does not prove that the attempted snapshot was never 
published; preserving its files is appropriate. The behind-head mock failure 
alone should not be treated as a remaining cleanup defect.
   
   I am checking a separate cache-invalidation issue in this revision against 
the previous head, using explicit snapshot-ID reads after successful replay.



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