KKcorps commented on code in PR #15831:
URL: https://github.com/apache/pinot/pull/15831#discussion_r2123098296


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/IngestionDelayTracker.java:
##########
@@ -416,16 +502,74 @@ public long getPartitionIngestionOffsetLag(int 
partitionId) {
     if (ingestionInfo == null) {
       return 0;
     }
-    StreamPartitionMsgOffset currentOffset = ingestionInfo._currentOffset;
-    StreamPartitionMsgOffset latestOffset = ingestionInfo._latestOffset;
+    return ingestionInfo._offsetLag;
+  }
+
+  private StreamPartitionMsgOffset fetchStreamOffset(OffsetCriteria 
offsetCriteria, long maxWaitTimeMs,
+      StreamMetadataProvider streamMetadataProvider) {
+    try {
+      return streamMetadataProvider.fetchStreamPartitionOffset(offsetCriteria, 
maxWaitTimeMs);
+    } catch (Exception e) {
+      LOGGER.debug("Caught exception while fetching stream offset", e);
+    }
+    return null;
+  }
+
+  /**
+   * Creates a new stream metadata provider
+   */
+  private StreamMetadataProvider createPartitionMetadataProvider(String 
reason, String clientId, int partitionGroupId) {
+    LOGGER.info("Creating new partition metadata provider, reason: {}", 
reason);
+    return _streamConsumerFactory.createPartitionMetadataProvider(clientId, 
partitionGroupId);
+  }
+
+  private void updateOffsetLagForAllPartitions() {
+    List<Map.Entry<Integer, IngestionInfo>> entries = new 
ArrayList<>(_ingestionInfoMap.entrySet());

Review Comment:
   Yep
   Unnecessarily adding a lag metric for a transition that has not occurred 
doesn't make sense
   e.g. post-rebalance and server restart we might genuinely not have any 
consuming segments for this partition but we'll unnecessarily keep reporting 
lag metrics



-- 
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