apache / paimon

Apache Paimon is a lake format that enables building a Realtime Lakehouse Architecture with Flink and Spark for both streaming and batch operations.
https://paimon.apache.org/
Apache License 2.0
2.16k stars 855 forks source link

[flink] Async lookup writer should store active buckets in state to make sure changelog can be produced #3512

Closed tsreaper closed 1 month ago

tsreaper commented 1 month ago

Purpose

Currently Flink Paimon writer operator is stateless. However for an async lookup table (that is, specify both 'changelog-producer' = 'lookup' and 'changelog-producer.lookup-wait' = 'false'), when a job failure occurs, it is possible that some writers are still compacting records. When the job restarts, if there are no new records for these writers to write, they won't be created again and these buckets will remain un-compacted. Thus, some changelog might be lost because lookup tables rely on compaction to produce changelog.

This PR stores active buckets into Flink state for async lookup writer to make sure changelog can be produced.

Tests

API and Format

No changes.

Documentation

No new feature.