You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/06/17 00:01:47 UTC

[GitHub] [pinot] PrachiKhobragade commented on a diff in pull request #8911: add freshness lag when there are no consuming segments

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


##########
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:
   shouldn't it be warn because this block shouldn't reach in happy-path, something is wrong here



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

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


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