mxm commented on code in PR #18303:
URL: https://github.com/apache/iceberg/pull/18303#discussion_r4231406496
##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/DynamicCommitter.java:
##########
@@ -181,17 +196,29 @@ public void
commit(Collection<CommitRequest<DynamicCommittable>> commitRequests)
jobEntry.getValue().tailMap(maxCommittedCheckpointId, false);
if (!uncommitted.isEmpty()) {
commitPendingRequests(
- table, tableKey.branch(), uncommitted, jobKey.jobId(),
jobKey.operatorId());
+ table,
+ tableKey.branch(),
+ uncommitted,
+ jobKey.jobId(),
+ jobKey.operatorId(),
+ latestSnapshotId);
}
}
}
}
private static long getMaxCommittedCheckpointId(
- Iterable<Snapshot> ancestors, String flinkJobId, String operatorId) {
+ Iterable<Snapshot> ancestors,
+ String flinkJobId,
+ String operatorId,
+ @Nullable Long stopAtSnapshotId) {
long lastCommittedCheckpointId = INITIAL_CHECKPOINT_ID;
for (Snapshot ancestor : ancestors) {
+ if (stopAtSnapshotId != null && stopAtSnapshotId ==
ancestor.snapshotId()) {
+ break;
+ }
Review Comment:
This is an extra fix compared to
https://github.com/apache/iceberg/pull/18123. I suppose want to avoid walking
the entire snapshot chain. I would remove this special-casing for the narrow
edge case we're fixing in this PR. AFAIK, it is only for the first commit?
--
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]