Skip to content

fix(scan): allocate snapshot buffers from the scan memory pool - #588

Open
realAaronWu wants to merge 3 commits into
apache:mainfrom
realAaronWu:codex/paimon-587-snapshot-memory
Open

realAaronWu wants to merge 3 commits into
apache:mainfrom
realAaronWu:codex/paimon-587-snapshot-memory

Conversation

@realAaronWu

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #587

Load filesystem snapshots into a buffer allocated from the scan's custom memory pool. Request the buffer before reading the snapshot so the caller's remaining budget applies to the input bytes. Return a resource error if the pool refuses the allocation.

Tests

The regression exercises CreatePlan() with a snapshot larger than the pool's remaining capacity. It checks refusal before reading, explicit stream closure, cleanup after malformed JSON and a short read, and successful replanning with a fresh scan using the same pool.

API and Format

Updated the WithMemoryPool() documentation. C++ signatures and persistent formats are unchanged.

Documentation

The scan context documents pool-backed loading of numbered snapshot files.

Generative AI tooling

Generated-by: OpenAI Codex (GPT-6)

Aaron Wu added 3 commits November 22, 2026 23:43
@realAaronWu
realAaronWu marked this pull request as ready for review November 23, 2026 03:36
@realAaronWu

Copy link
Copy Markdown
Contributor Author

@lxy-9602 Could you approve the GitHub Actions workflows for this PR? The snapshot memory-pool regression passed on Linux, and Build and Test is awaiting approval. Thanks!

This branch has not been deployed

No deployments
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.

[Bug] Snapshot loading in CreatePlan allocates outside the caller-supplied MemoryPool

1 participant