Skip to content

feat: PartialSegmentFileMapper no longer lazy loads#19693

Merged
clintropolis merged 2 commits into
apache:masterfrom
clintropolis:refine-partial-file-mapper
Jul 17, 2026
Merged

feat: PartialSegmentFileMapper no longer lazy loads#19693
clintropolis merged 2 commits into
apache:masterfrom
clintropolis:refine-partial-file-mapper

Conversation

@clintropolis

Copy link
Copy Markdown
Member

Description

After #19683, all partial load operations are now deliberately planned, so this PR begins to clean some stuff up by removing the lazy load behavior of mapFile, which prior to this patch would perform a load on demand if the internal file we were trying to map was not present in the segment. mapFile now throws if the file is not present since lazy loading in this fashion (like, done inline with processing) is unlikely to ever be desired behavior.

Eventually I'd like to consolidate all fetching to be the parallel planned fetches, but some of the refactoring required is a bit more involved than this change (e.g. the full-load fallback the native engines use), so will save this for a follow-up.

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

Severity Findings
P0 0
P1 1
P2 0
P3 0
Total 1
Severity Findings
P0 0
P1 1
P2 0
P3 0
Total 1

Reviewed 6 of 6 changed files.

Found one lifecycle race: eviction between residency planning and bundle acquisition can leave required files unfetched and make cursor construction fail.


This is an automated review by Codex GPT-5.6-Sol

ensureFileDownloaded(name, fileMetadata);
// Mapping never downloads, every caller is expected to have made the file resident through an explicit plan before
// reading it
if (!downloadedFiles.contains(name)) {

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.

[P1] Acquire bundle holds before planning resident files

makeCursorHolderAsync snapshots residency in planCursorPrefetch before acquiring the corresponding bundle holds. If a resident, currently unheld bundle is evicted in that window, evictContainer clears its downloaded-file entries and the subsequent acquire only remounts sparse containers; files omitted from the original plan are never restored. This new exception then makes holder materialization fail, whereas the removed ensureFileDownloaded path recovered under the hold. Acquire bundle holds before the residency snapshot, or re-plan the fetches after all holds are acquired.

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.

while fixing this, also noticed a flaw in PartialQueryableIndex that the column holder suppliers are memoized, but do not consider if their underlying bundles have/have not been evicted, so added some 'generation' tracking for the bundles and special suppliers that can check if they were created for the current generation or not.

@clintropolis
clintropolis merged commit aedca20 into apache:master Jul 17, 2026
38 checks passed
@clintropolis
clintropolis deleted the refine-partial-file-mapper branch July 17, 2026 05:06
@github-actions github-actions Bot added this to the 38.0.0 milestone Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants