findingrish commented on code in PR #13967:
URL: https://github.com/apache/druid/pull/13967#discussion_r1694233679


##########
server/src/main/java/org/apache/druid/client/CachingClusteredClient.java:
##########
@@ -456,14 +466,42 @@ private Set<SegmentServerSelector> computeSegmentsToQuery(
         }
         for (PartitionChunk<ServerSelector> chunk : filteredChunks) {
           ServerSelector server = chunk.getObject();
+          if (brokerSegmentWatcherConfig.isDetectUnavailableSegments() && 
!server.isQueryable()) {
+            log.debug("ServerSelector for segment id [%s] is not queryable", 
server.getSegment().getId());
+            continue;
+          }
           final SegmentDescriptor segment = new SegmentDescriptor(
               holder.getInterval(),
               holder.getVersion(),
               chunk.getChunkNumber()
           );
           segments.add(new SegmentServerSelector(server, segment));
+          if (server.isEmpty()) {
+            unavailableSegmentsIds.add(server.getSegment().getId());
+          }
+        }
+      }
+
+      if (brokerSegmentWatcherConfig.isDetectUnavailableSegments() && 
unavailableSegmentsIds.size() > 0) {
+        log.warn(
+            "Detected [%d] unavailable segments, segment ids: [%s]",
+            unavailableSegmentsIds.size(),
+            unavailableSegmentsIds
+        );
+        if (unavailableSegmentsAction == UnavailableSegmentsAction.FAIL) {
+          throw new QueryException(
+              QueryException.UNAVAILABLE_SEGMENTS_ERROR_CODE,
+              StringUtils.format(
+                  "Detected [%d] unavailable segments, segment ids: [%s]",

Review Comment:
   Trimmed the list to log 10 segment ids. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to