Repository navigation
Conversation
Add `LanceExecutionOptions::memory_pool` and per-operation setters on `Scanner`, `MergeInsertBuilder`, and `DatasetDeltaBuilder` so embedders can control the DataFusion memory pool's sizing and sharing policy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, callers could only set the size of the DataFusion memory pool (
mem_pool_size/LANCE_MEM_POOL_SIZE). Lance decided how that pool was shared, and since #9408 each spilling execution gets its own fresh pool. As a result, N concurrent merge_insert or delta operations can use N times the configured budget, and a server has no way to enforce a single node-wide limit.This PR adds
LanceExecutionOptions::memory_pool. When it is set, executions use that pool as given, whether or not spilling is enabled, andmem_pool_sizeis ignored. Sessions built with a supplied pool skip the session cache. The sort spill reservation comes from the pool's limit when that limit is finite. Callers who don't set it get the same behavior as before.The option can also be set per operation:
Scanner::memory_poolcovers scans,count_rows, andanalyze_plan.MergeInsertBuilder::memory_poolcovers the plan-based merge, the indexed and full-table joins, and the fragment-patch sort.DatasetDeltaBuilder::with_memory_poolcovers the delta scans and the deleted-row anti join.Example
Not included
Scalar index training does not take the pool yet. That needs changes to
CreateIndexBuilderand the optimize path, plus the trainer sorts in lance-index (btree, label_list, json, hilbert). It will come in a follow-up PR.Part of #9799
🤖 Generated with Claude Code