Replace segmentDirectoryConfigs map with ReadMode in SegmentDirectoryLoaderContext#18806
Merged
Jackie-Jiang merged 1 commit intoJun 18, 2026
Conversation
…LoaderContext SegmentDirectoryLoaderContext's segmentDirectoryConfigs was a Map<String, String> that only ever carried a single "readMode" entry. Replace it with a typed ReadMode field. - Add ReadMode to the context and builder (defaults to ReadMode.DEFAULT_MODE); remove getSegmentDirectoryConfigs()/setSegmentDirectoryConfigs(). - DefaultSegmentDirectoryLoader and TierBasedSegmentDirectoryLoader now read context.getReadMode() directly instead of parsing the map. - Remove IndexLoadingConfig.getSegmentDirectoryConfigs() and update all builder call sites to setReadMode(...).
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #18806 +/- ##
============================================
+ Coverage 64.78% 64.79% +0.01%
Complexity 1309 1309
============================================
Files 3381 3386 +5
Lines 209967 210089 +122
Branches 32891 32913 +22
============================================
+ Hits 136020 136136 +116
- Misses 62979 62990 +11
+ Partials 10968 10963 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
xiangfu0
approved these changes
Jun 18, 2026
cypherean
pushed a commit
to cypherean/pinot
that referenced
this pull request
Jun 24, 2026
xiangfu0
pushed a commit
that referenced
this pull request
Jun 27, 2026
#18863) PR #18806 inadvertently dropped the segmentLoaderContext argument when constructing SegmentLocalFSDirectory, leaving SingleFileIndexDirectory's _segmentDirectoryLoaderContext field null. This causes the task-config propagation logic added in PR #18264 (SingleFileIndexDirectory#serializeTaskConfigToJsonFromContext) to short-circuit at its first guard, so task.config.json is never injected into EmptyIndexBuffer.properties and downstream consumers silently fall back to ambient credential defaults. Restore the prior behavior by constructing SegmentMetadataImpl and passing both the metadata and the loader context to SegmentLocalFSDirectory's 4-arg constructor.
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.
Summary
SegmentDirectoryLoaderContext.segmentDirectoryConfigswas aMap<String, String>that in practice only ever held a singlereadModeentry (built byIndexLoadingConfigasMap.of(READ_MODE_KEY, readMode)and read back viaReadMode.valueOf(map.get(READ_MODE_KEY))). This replaces the stringly-typed map with a typedReadModefield.Changes:
SegmentDirectoryLoaderContext: add aReadModefield (builder defaults toReadMode.DEFAULT_MODE); removegetSegmentDirectoryConfigs()/setSegmentDirectoryConfigs().DefaultSegmentDirectoryLoader/TierBasedSegmentDirectoryLoader: readcontext.getReadMode()directly instead of parsing the map.IndexLoadingConfig.getSegmentDirectoryConfigs(); update all builder call sites tosetReadMode(...).SegmentLocalFSDirectory: consolidate constructors around(File, SegmentMetadataImpl, ReadMode, @Nullable SegmentDirectoryLoaderContext).This changes the public
SegmentDirectoryLoaderContextSPI consumed by customSegmentDirectoryLoaderimplementations.ReadMode.DEFAULT_MODEresolves tommap, so default behavior is unchanged.