PrachiKhobragade commented on code in PR #8911:
URL: https://github.com/apache/pinot/pull/8911#discussion_r900618313


##########
pinot-core/src/main/java/org/apache/pinot/core/query/executor/ServerQueryExecutorV1Impl.java:
##########
@@ -261,12 +272,22 @@ private DataTable processQueryInternal(ServerQueryRequest 
queryRequest, Executor
       _serverMetrics.addMeteredTableValue(tableNameWithType, 
ServerMeter.NUM_MISSING_SEGMENTS, numMissingSegments);
     }
 
+    long minConsumingFreshnessTimeMs = Long.MAX_VALUE;
     if (numConsumingSegments > 0) {
-      long minConsumingFreshnessTimeMs = minIngestionTimeMs != Long.MAX_VALUE 
? minIngestionTimeMs : minIndexTimeMs;
-      LOGGER.debug("Request {} queried {} consuming segments with 
minConsumingFreshnessTimeMs: {}", requestId,
-          numConsumingSegments, minConsumingFreshnessTimeMs);
+      minConsumingFreshnessTimeMs = minIngestionTimeMs != Long.MAX_VALUE ? 
minIngestionTimeMs : minIndexTimeMs;
       metadata.put(MetadataKey.NUM_CONSUMING_SEGMENTS_PROCESSED.getName(), 
Integer.toString(numConsumingSegments));
       metadata.put(MetadataKey.MIN_CONSUMING_FRESHNESS_TIME_MS.getName(), 
Long.toString(minConsumingFreshnessTimeMs));
+      LOGGER.debug("Request {} queried {} consuming segments with 
minConsumingFreshnessTimeMs: {}", requestId,
+          numConsumingSegments, minConsumingFreshnessTimeMs);
+    } else if (numConsumingSegments == 0 && maxEndTimeMs != Long.MIN_VALUE) {
+      minConsumingFreshnessTimeMs = maxEndTimeMs;
+      metadata.put(MetadataKey.MIN_CONSUMING_FRESHNESS_TIME_MS.getName(), 
Long.toString(maxEndTimeMs));
+      LOGGER.debug("Request {} queried {} consuming segments with 
minConsumingFreshnessTimeMs: {}", requestId,
+          numConsumingSegments, minConsumingFreshnessTimeMs);
+    } else if (numOnlineSegments == 0) {
+      // case: no immutable segments, no metric emitted
+      LOGGER.warn("Request {} queried no consuming or online segments, with 
minConsumingFreshnessTimeMs: {}", requestId,

Review Comment:
   removed this block



-- 
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...@pinot.apache.org

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


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

Reply via email to