Skip to content

feat(realtime): improve append table lifecycle and query support - #213

Merged
SteNicholas merged 8 commits into
apache:mainfrom
lxy-9602:rt-append-todo
Aug 24, 2026
Merged

feat(realtime): improve append table lifecycle and query support#213
SteNicholas merged 8 commits into
apache:mainfrom
lxy-9602:rt-append-todo

Conversation

@lxy-9602

Copy link
Copy Markdown
Member

Purpose

Linked issue: #158

This PR completes several follow-up capabilities for append-table real-time reads and writes:

  • support batch-level statistics and predicate pushdown in the default Arrow RealtimeStore;
  • support count readers and independently schedulable disk splits;
  • make CommitWithProgress retries idempotent;
  • preserve real-time progress across compaction and require context recreation after rollback;
  • clean up expired and orphan real-time offset files;
  • extend integration coverage for commit retry, compaction, rollback, schema rename, predicate pushdown, offset cleanup, and memory reclamation.

Tests

API and Format

  • Adds the realtime.store.stats-mode option with none and full modes.
  • Adds StatisticsMode to RealtimeStoreFactory::Create.
  • Clarifies retry and rollback behavior in the public APIs.

Documentation

Generative AI tooling

Generated-by: OpenAI Codex (GPT-5)

@zjw1111 zjw1111 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the realtime lifecycle / query changes. A few questions on the commit idempotency model and on StatisticsMode semantics, two perf points worth confirming, plus one test-coverage gap and three style nits. Inline.

Comment thread src/paimon/core/operation/file_store_commit_impl.cpp
Comment thread src/paimon/core/realtime/arrow_realtime_store.cpp
Comment thread include/paimon/realtime/realtime_store.h Outdated
Comment thread src/paimon/core/operation/expire_snapshots.cpp Outdated
Comment thread src/paimon/core/operation/file_store_commit_impl.cpp
Comment thread src/paimon/core/operation/expire_snapshots.cpp
Comment thread src/paimon/core/realtime/arrow_realtime_store_test.cpp Outdated
Comment thread src/paimon/core/core_options.h Outdated
Comment thread src/paimon/core/realtime/arrow_realtime_store_test.cpp Outdated
Comment thread src/paimon/core/table/source/append_count_reader.cpp Outdated
Comment thread src/paimon/core/core_options.h

@zjw1111 zjw1111 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

CreateManifestCommittable(identifier, commit_messages, watermark, /*properties=*/{});
PAIMON_ASSIGN_OR_RAISE(std::vector<std::shared_ptr<ManifestCommittable>> pending_committables,
FilterCommitted({committable}));
const bool identifier_committed = pending_committables.empty();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FilterCommitted only compares this identifier with the latest identifier for the commit user; it does not establish that this exact (commit_user, commit_identifier) produced a snapshot. If commit A succeeds but its response is lost, and a later commit B from the same user succeeds before A is retried, this branch can classify A as committed merely because B has a higher identifier. When A’s ranges are covered it then returns the latest snapshot (B) at line 959, despite the public API promising the snapshot produced by this commit. Please look up the snapshot for the exact identity and return its ID; if the ranges were committed by another identity, reject the retry.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out. CommitWithProgress intentionally follows the same identifier high-watermark semantics as FilterAndCommit; its return value is the latest snapshot covering the requested offset progress, so it can be passed to RefreshCommittedSnapshot. It is not intended to identify the exact snapshot produced by the retried commit.

I’ve clarified this contract in the API documentation and added a test covering A → B → retry A, where the retry returns B’s latest snapshot ID.

@SteNicholas SteNicholas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@SteNicholas
SteNicholas merged commit 15d079a into apache:main Aug 24, 2026
16 checks passed
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.

3 participants