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

yashmayya 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 5232e28388d Add logs for segment status checker to be able to debug 
which segment is failing check (#16437)
5232e28388d is described below

commit 5232e28388d64863ab86df3699257da56af8225c
Author: Krishan Goyal <[email protected]>
AuthorDate: Tue Jul 29 17:00:25 2025 +0530

    Add logs for segment status checker to be able to debug which segment is 
failing check (#16437)
---
 .../pinot/controller/helix/SegmentStatusChecker.java | 13 ++++++++++---
 .../controller/util/ServerQueryInfoFetcher.java      | 20 +++++++++++++++++++-
 .../apache/pinot/core/common/MinionConstants.java    |  6 +++++-
 3 files changed, 34 insertions(+), 5 deletions(-)

diff --git 
a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/SegmentStatusChecker.java
 
b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/SegmentStatusChecker.java
index a86bbaf10a1..378fb9b55e4 100644
--- 
a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/SegmentStatusChecker.java
+++ 
b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/SegmentStatusChecker.java
@@ -366,9 +366,16 @@ public class SegmentStatusChecker extends 
ControllerPeriodicTask<SegmentStatusCh
           for (Map.Entry<String, String> entry : stateMap.entrySet()) {
             String serverInstanceId = entry.getKey();
             String segmentState = entry.getValue();
-            if ((segmentState.equals(SegmentStateModel.ONLINE) || 
segmentState.equals(SegmentStateModel.CONSUMING))
-                && 
isServerQueryable(serverQueryInfoFetcher.getServerQueryInfo(serverInstanceId))) 
{
-              numEVReplicasUp++;
+            if 
(isServerQueryable(serverQueryInfoFetcher.getServerQueryInfo(serverInstanceId)))
 {
+              if (segmentState.equals(SegmentStateModel.ONLINE) || 
segmentState.equals(SegmentStateModel.CONSUMING)) {
+                numEVReplicasUp++;
+              } else {
+                LOGGER.warn("Segment {} in table {} has state {} on instance 
{}. Marking it as unavailable",
+                    segment, tableNameWithType, segmentState, 
serverInstanceId);
+              }
+            } else {
+              LOGGER.warn("Segment {} in table {} has state {} on unavailable 
instance {}. Marking it as unavailable",
+                  segment, tableNameWithType, segmentState, serverInstanceId);
             }
             if (segmentState.equals(SegmentStateModel.ERROR)) {
               errorSegments.add(Pair.of(segment, entry.getKey()));
diff --git 
a/pinot-controller/src/main/java/org/apache/pinot/controller/util/ServerQueryInfoFetcher.java
 
b/pinot-controller/src/main/java/org/apache/pinot/controller/util/ServerQueryInfoFetcher.java
index 2ac53ae508e..83a5bc9046b 100644
--- 
a/pinot-controller/src/main/java/org/apache/pinot/controller/util/ServerQueryInfoFetcher.java
+++ 
b/pinot-controller/src/main/java/org/apache/pinot/controller/util/ServerQueryInfoFetcher.java
@@ -27,6 +27,8 @@ import org.apache.helix.zookeeper.datamodel.ZNRecord;
 import org.apache.pinot.controller.helix.core.PinotHelixResourceManager;
 import org.apache.pinot.spi.utils.CommonConstants;
 import org.apache.pinot.spi.utils.InstanceTypeUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -34,6 +36,7 @@ import org.apache.pinot.spi.utils.InstanceTypeUtils;
  * repeated ZK access. This class is NOT thread-safe.
  */
 public class ServerQueryInfoFetcher {
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(ServerQueryInfoFetcher.class);
   private final PinotHelixResourceManager _pinotHelixResourceManager;
   private final Map<String, ServerQueryInfo> _cache;
 
@@ -51,6 +54,7 @@ public class ServerQueryInfoFetcher {
   private ServerQueryInfo getServerQueryInfoOndemand(String instanceId) {
     InstanceConfig instanceConfig = 
_pinotHelixResourceManager.getHelixInstanceConfig(instanceId);
     if (instanceConfig == null || !InstanceTypeUtils.isServer(instanceId)) {
+      LOGGER.warn("Instance config for instanceId {} is null or not a server 
instance", instanceId);
       return null;
     }
     List<String> tags = instanceConfig.getTags();
@@ -59,7 +63,11 @@ public class ServerQueryInfoFetcher {
     boolean queriesDisabled = 
record.getBooleanField(CommonConstants.Helix.QUERIES_DISABLED, false);
     boolean shutdownInProgress = 
record.getBooleanField(CommonConstants.Helix.IS_SHUTDOWN_IN_PROGRESS, false);
 
-    return new ServerQueryInfo(instanceId, tags, null, helixEnabled, 
queriesDisabled, shutdownInProgress);
+    ServerQueryInfo queryInfo = new ServerQueryInfo(
+        instanceId, tags, null, helixEnabled, queriesDisabled, 
shutdownInProgress);
+
+    LOGGER.info("Fetched ServerQueryInfo for instanceId {}: {}", instanceId, 
queryInfo);
+    return queryInfo;
   }
 
   public static class ServerQueryInfo {
@@ -91,5 +99,15 @@ public class ServerQueryInfoFetcher {
     public boolean isShutdownInProgress() {
       return _shutdownInProgress;
     }
+
+    @Override
+    public String toString() {
+      return "ServerQueryInfo{"
+          + "instanceName='" + _instanceName + '\''
+          + ", helixEnabled=" + _helixEnabled
+          + ", queriesDisabled=" + _queriesDisabled
+          + ", shutdownInProgress=" + _shutdownInProgress
+          + '}';
+    }
   }
 }
diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/common/MinionConstants.java 
b/pinot-core/src/main/java/org/apache/pinot/core/common/MinionConstants.java
index cbb13bd8abd..4c2285125a3 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/common/MinionConstants.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/common/MinionConstants.java
@@ -31,10 +31,14 @@ public class MinionConstants {
   public static final String TASK_TIME_SUFFIX = ".time";
 
   public static final String TABLE_NAME_KEY = "tableName";
+
+  // Input segment name(s) and download url(s) for those segments for the 
minion task.
+  // If there are multiple segments, they are separated by 
SEGMENT_NAME_SEPARATOR.
+  // The index of the segment name and download url is the same for the same 
segment.
   public static final String SEGMENT_NAME_KEY = "segmentName";
   public static final String DOWNLOAD_URL_KEY = "downloadURL";
+
   public static final String UPLOAD_URL_KEY = "uploadURL";
-  public static final String DOT_SEPARATOR = ".";
   public static final String URL_SEPARATOR = ",";
   public static final String SEGMENT_NAME_SEPARATOR = ",";
   public static final String AUTH_TOKEN = "authToken";


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

Reply via email to