This is an automated email from the ASF dual-hosted git repository.

xiangfu0 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new bec3dcc36f1 Forward SegmentDirectoryLoaderContext in 
DefaultSegmentDirectoryLoader (#18863)
bec3dcc36f1 is described below

commit bec3dcc36f1759b206ca72474f3ea19f2857fa98
Author: RAGHVENDRA KUMAR YADAV <[email protected]>
AuthorDate: Sat Jun 27 04:21:52 2026 -0700

    Forward SegmentDirectoryLoaderContext in DefaultSegmentDirectoryLoader 
(#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.
---
 .../segment/local/loader/DefaultSegmentDirectoryLoader.java  | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/loader/DefaultSegmentDirectoryLoader.java
 
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/loader/DefaultSegmentDirectoryLoader.java
index 9998163b96e..e41d279ccab 100644
--- 
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/loader/DefaultSegmentDirectoryLoader.java
+++ 
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/loader/DefaultSegmentDirectoryLoader.java
@@ -22,6 +22,7 @@ import java.io.File;
 import java.net.URI;
 import org.apache.commons.io.FileUtils;
 import org.apache.pinot.segment.local.segment.store.SegmentLocalFSDirectory;
+import org.apache.pinot.segment.spi.index.metadata.SegmentMetadataImpl;
 import org.apache.pinot.segment.spi.loader.SegmentDirectoryLoader;
 import org.apache.pinot.segment.spi.loader.SegmentDirectoryLoaderContext;
 import org.apache.pinot.segment.spi.loader.SegmentLoader;
@@ -39,7 +40,12 @@ public class DefaultSegmentDirectoryLoader implements 
SegmentDirectoryLoader {
 
   /**
    * Creates and loads the {@link SegmentLocalFSDirectory} which is the 
default implementation of
-   * {@link SegmentDirectory}
+   * {@link SegmentDirectory}.
+   *
+   * <p>The {@link SegmentDirectoryLoaderContext} is forwarded into the {@link 
SegmentLocalFSDirectory}
+   * so downstream consumers (e.g. {@code 
SingleFileIndexDirectory#createRemoteBuffers}) can use it to
+   * propagate the table's task configuration into remote/empty index buffers.
+   *
    * @param indexDir segment index directory
    * @param segmentLoaderContext context for instantiation of the 
SegmentDirectory
    * @return instance of {@link SegmentLocalFSDirectory}
@@ -51,7 +57,9 @@ public class DefaultSegmentDirectoryLoader implements 
SegmentDirectoryLoader {
     if (!directory.exists()) {
       return new SegmentLocalFSDirectory(directory);
     }
-    return new SegmentLocalFSDirectory(directory, 
segmentLoaderContext.getReadMode());
+    SegmentMetadataImpl metadata = new SegmentMetadataImpl(directory);
+    return new SegmentLocalFSDirectory(directory, metadata, 
segmentLoaderContext.getReadMode(),
+        segmentLoaderContext);
   }
 
   @Override


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to