aiborodin commented on code in PR #14810:
URL: https://github.com/apache/iceberg/pull/14810#discussion_r2609629056


##########
flink/v2.0/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/DynamicCommitter.java:
##########
@@ -126,9 +125,14 @@ public void 
commit(Collection<CommitRequest<DynamicCommittable>> commitRequests)
       return;
     }
 
-    // For every table and every checkpoint, we store the list of 
to-be-committed
-    // DynamicCommittable.
-    // There may be DynamicCommittable from previous checkpoints which have 
not been committed yet.
+    /*
+      Each (table, branch, checkpoint) triplet must have only one commit 
request.
+      There may be commit requests from previous checkpoints which have not 
been committed yet.
+
+      We currently keep a List of commit requests per checkpoint instead of a 
single CommitRequest<DynamicCommittable>
+      to process the Flink state from previous releases, which had multiple 
commit requests due to a bug in the upstream
+      DynamicWriteResultAggregator. We should replace this with a single 
commit request in the next major release.

Review Comment:
   I see the following timeline for the upgrade and the state migration:
   1. We release this fix in the next minor Iceberg version - 1.10.1. It allows 
users to pick up the new change quickly and migrate their state to a single 
committable per table/branch/checkpoint.
   2. We remove the support of lists in the next major release: 1.11.0.
   
   This timeframe gives users enough time for a smooth migration. I updated the 
comment to reflect this.
   
   What do you think?



##########
flink/v2.0/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/DynamicCommitter.java:
##########
@@ -210,36 +218,40 @@ private void commitPendingRequests(
     NavigableMap<Long, List<WriteResult>> pendingResults = Maps.newTreeMap();
     for (Map.Entry<Long, List<CommitRequest<DynamicCommittable>>> e : 
commitRequestMap.entrySet()) {
       for (CommitRequest<DynamicCommittable> committable : e.getValue()) {
-        if (Arrays.equals(EMPTY_MANIFEST_DATA, 
committable.getCommittable().manifest())) {
+        if (Arrays.deepEquals(EMPTY_MANIFEST_DATA, 
committable.getCommittable().manifests())) {

Review Comment:
   Done



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to