Skip to content

[Feature][Connector-V2] Support two-phase commit exactly-once write for Hudi sink #12439

Description

@corgy-w

Search before asking

  • I had searched in the feature and found no similar feature requirement.

Description

The Hudi sink commits every flushed batch with the Hudi client auto-commit, so the records become visible before the checkpoint that contains them completes. When a job fails and the source replays the records of a checkpoint that never completed, those records are committed to Hudi a second time. The sink therefore only provides at-least-once delivery for Zeta, see docs/en/connectors/sink/Hudi.md and the earlier timer flush work in #11747.

It would be useful for the sink to support the two-phase commit protocol of the engine, so that the records of a checkpoint are committed to Hudi only after that checkpoint completes, which gives exactly-once delivery. Hudi itself supports this pattern: the data is written into an instant while the job is running, and the instant is committed afterwards, so readers only see completed instants.

Usage Scenario

  • A streaming job replicates data from a CDC/JDBC source into Hudi and must not duplicate records when the job fails and restarts from a checkpoint.
  • A batch job writes into Hudi and needs the whole checkpoint to be published atomically instead of batch by batch.

Related issues

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions