JingsongLi commented on code in PR #10625:
URL: https://github.com/apache/paimon/pull/10625#discussion_r4306252564


##########
paimon-core/src/main/java/org/apache/paimon/utils/TagManager.java:
##########
@@ -64,10 +66,18 @@ public class TagManager {
 
     public static final String TAG_PREFIX = "tag-";
 
+    /**
+     * One reentrant lock per table and branch, shared by every {@link 
TagManager} for that key so
+     * tag creation and snapshot expiration cannot interleave.
+     */
+    private static final ConcurrentHashMap<String, ReentrantLock> 
COORDINATION_LOCKS =

Review Comment:
   [P1] Coordinate tag creation and expiration across JVMs
   
   This static map only shares locks within one JVM/classloader. A continuously 
running writer expires snapshots in its JVM, while the documented standalone 
`flink run ... create_tag` action or a separate Spark/Java client creates tags 
in another JVM. Those operations take independent locks, and 
`ensureSnapshotRetained` still succeeds because the snapshot metadata is 
deleted after its data/manifests.
   
   I reproduced this on this head using the existing expiration test fixture: 
pause expiration via `setAfterTagCollection`, create a tag for snapshot #2 in a 
separate Java process, then resume expiration. The child reports success; 
afterward `tagExists=true`, `snapshotExists=false`, 
`deltaManifestExists=false`, and reading the tag fails with `Failed to read 
manifest-list-...`. Thus the PR still permits the data-retention failure it 
claims to fix in #9220. Please use coordination/GC protection shared by all 
participating processes and add a deterministic independent-JVM regression 
test; snapshot-existence checks alone cannot close this window.



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