Guosmilesmile commented on code in PR #18303:
URL: https://github.com/apache/iceberg/pull/18303#discussion_r4269351501
##########
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:
Added a test for this: checkpoint 5 is committed, then a compaction lands on
top, then checkpoint 5 is replayed with `isRestored=true`. It is skipped,
because the pre-check walks the full ancestry (no stop snapshot) and finds the
Flink snapshot beneath the compaction.
--
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]