Skip to content

feat(realtime): support spilling sealed segments - #327

Merged
SteNicholas merged 7 commits into
apache:mainfrom
lxy-9602:rt-spill
Sep 15, 2026
Merged

SteNicholas merged 7 commits into
apache:mainfrom
lxy-9602:rt-spill

Conversation

@lxy-9602

@lxy-9602 lxy-9602 commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Purpose

Linked issue: #158

Add opt-in disk spill support for the default real-time store to reduce memory retained by sealed segments.

  • Spill each sealed segment to a local Arrow IPC file.
  • Release in-memory batches after spill while keeping pinned views readable.
  • Support spilled query and commit readers for append-only and PK tables.
  • Delete spill files after their last reference is released.
  • Reuse common Arrow IPC utilities in the existing merge-tree spill path.
  • Support configurable read batch sizes for real-time queries by slicing large in-memory and spilled batches.

Tests

Added unit and integration coverage for:

  • Spill configuration and validation.
  • Memory and spilled reads.
  • Append-only and PK deletion-vector commit/read flows.
  • Spill-file lifetime during pinned reads and reclaim.
  • PK reads before and after reclaim.
  • Read batch slicing.

API and Format

Adds realtime.spill-enabled and spill context fields.

No persistent table format change. Spill files are temporary local Arrow IPC files.

Documentation

Generative AI tooling

Generated-by: OpenAI Codex (GPT-5)

Comment thread src/paimon/core/mergetree/spill_writer.cpp Outdated

@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.

One resource-management issue in the PK spill read path.

Comment thread src/paimon/core/realtime/arrow_realtime_store.cpp Outdated
Comment thread src/paimon/core/realtime/arrow_realtime_store.h
Comment thread src/paimon/core/realtime/arrow_realtime_store.cpp

@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

@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 21228d9 into apache:main Sep 15, 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