Skip to content

[python][ray] Add periodic commits to write_paimon - #9056

Closed
XiaoHongbo-Hope wants to merge 6 commits into
apache:masterfrom
XiaoHongbo-Hope:codex/write-paimon-periodic-commit
Closed

[python][ray] Add periodic commits to write_paimon#9056
XiaoHongbo-Hope wants to merge 6 commits into
apache:masterfrom
XiaoHongbo-Hope:codex/write-paimon-periodic-commit

Conversation

@XiaoHongbo-Hope

@XiaoHongbo-Hope XiaoHongbo-Hope commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Purpose

write_paimon normally publishes one snapshot after the entire Ray Dataset finishes. For a job that runs for hours or days, a late failure leaves none of that write visible, so users must manually split the input and call write_paimon batch by batch.

This PR makes that batching internal. With commit_mode="incremental", completed primary-key groups are committed at a target time interval. If a later group fails, earlier commits remain visible.

This is periodic commit, not source checkpoint recovery. Retrying reruns the Ray Dataset from the beginning and upserts already committed keys again.

Changes

  • add commit_mode="incremental", commit_interval_seconds, and update_cols to write_paimon;
  • periodically commit completed fixed-bucket primary-key groups;
  • update existing keys and insert new keys using merge-engine=partial-update;
  • retain completed commits after a later worker failure;
  • allow concurrent partial updates to different fields.

The target must be a fixed-bucket primary-key table using merge-engine=partial-update. Incremental mode requires Ray 2.33 or later. Concurrent jobs updating the same field must not rely on a deterministic winner.

Tests

  • real Ray E2E for periodic commits, upserts, worker failure, full retry, concurrent partial updates, 4096 buckets, partitioned composite keys, and compaction;
  • deterministic regression for a materialized Dataset whose group writes exceed the interval;
  • Hangzhou staging DLF + OSS E2E covering two periodic snapshots, concurrent updates to different fields, injected failure, full retry, and preserved non-updated columns;
  • uncertain-commit callback, Ray sink, shuffle, and table commit regressions;
  • project flake8 and git diff --check.

Latest local validation: 100 passed with Ray 2.56.1.

@XiaoHongbo-Hope
XiaoHongbo-Hope marked this pull request as ready for review August 6, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant