Commit 725a8e4
committed
[iceberg] Restore flush to clear factory cache for schema reload
flush(boolean) was a no-op to avoid splitting same-PK updates into
multiple batches within a checkpoint. But without clearing the writer
factory cache, new writes after a checkpoint could use a stale factory
that doesn't reflect schema changes applied by IcebergMetadataApplier.
Change flush to clear writerFactoryMap only. Writers themselves keep
running so same-PK updates within a checkpoint go through the same
writer and use position deletes (exact file+offset), which work
correctly within a single snapshot without needing a separate seq_num.
Schema-change flushes still go through flushTableWriter(tableId), which
drains the writer and bumps batchIndex so equality-deletes land in a
snapshot with a strictly higher sequence number than the data they target.1 parent 2f0ed03 commit 725a8e4
2 files changed
Lines changed: 21 additions & 16 deletions
File tree
- flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-iceberg/src
- main/java/org/apache/flink/cdc/connectors/iceberg/sink/v2
- test/java/org/apache/flink/cdc/connectors/iceberg/sink/v2
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
652 | | - | |
653 | | - | |
| 652 | + | |
| 653 | + | |
654 | 654 | | |
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
658 | 668 | | |
659 | 669 | | |
660 | 670 | | |
| |||
665 | 675 | | |
666 | 676 | | |
667 | 677 | | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
678 | 683 | | |
679 | 684 | | |
680 | 685 | | |
| |||
0 commit comments