[FLINK-35128][cdc-connector][cdc-base] Re-calculate the starting changelog offset after the new table added (#3230)

pull/3258/head
Hongshun Wang 9 months ago committed by GitHub
parent ddf557c8e1
commit bdca0e328b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -163,10 +163,18 @@ public class StreamSplit extends SourceSplitBase {
// -------------------------------------------------------------------
public static StreamSplit appendFinishedSplitInfos(
StreamSplit streamSplit, List<FinishedSnapshotSplitInfo> splitInfos) {
// re-calculate the starting changelog offset after the new table added
Offset startingOffset = streamSplit.getStartingOffset();
for (FinishedSnapshotSplitInfo splitInfo : splitInfos) {
if (splitInfo.getHighWatermark().isBefore(startingOffset)) {
startingOffset = splitInfo.getHighWatermark();
}
}
splitInfos.addAll(streamSplit.getFinishedSnapshotSplitInfos());
return new StreamSplit(
streamSplit.splitId,
streamSplit.getStartingOffset(),
startingOffset,
streamSplit.getEndingOffset(),
splitInfos,
streamSplit.getTableSchemas(),

Loading…
Cancel
Save