DanielLeens commented on code in PR #13712:
URL: https://github.com/apache/seatunnel/pull/13712#discussion_r4731343613


##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/checkpoint/CheckpointCoordinator.java:
##########
@@ -1448,6 +1447,11 @@ public synchronized void 
completePendingCheckpoint(CompletedCheckpoint completed
                                 .states(states)
                                 .build());
             }
+            // Only track a checkpoint after its state is durably stored (or 
after the type was
+            // deliberately not stored): the queue drives retention deletions, 
so an id recorded
+            // before a failed write would later be handed to 
deleteCheckpoint() although it never
+            // existed, and the queue would no longer describe the files on 
disk.
+            completedCheckpointIds.addLast(String.valueOf(checkpointId));

Review Comment:
   Thanks, @goutamadwant — good catch on the distinction between retention 
bookkeeping and physical failed-write cleanup. 
`LocalFileStorage.storeCheckPoint` touches the final file before writing it; an 
exception after that point can leave bytes even though this PR correctly avoids 
recording the ID as a successful persisted checkpoint. The reordered queue is 
therefore not a complete orphan-file cleanup mechanism.
   
   I would keep failed-write cleanup owned by the storage publication boundary: 
clean only the candidate created by that failed write, preserve the original 
failure and earlier valid checkpoints, and test a failure after file 
creation/partial output. Adding failed IDs back to the successful-retention 
ledger would reintroduce the defect this PR fixes. A provider-side atomic 
publication design is a broader alternative with a separate 
compatibility/verification cost. The existing regression rejects before 
publication, so it does not establish this post-touch cleanup case. No local 
failure injection was executed in this reply.



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