noob-se7en commented on code in PR #15831:
URL: https://github.com/apache/pinot/pull/15831#discussion_r2100616877
##########
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:
hmm I believe we have `llcPartitionConsuming` metric. So I guess if offline
-> consuming fails, that metric can be used for alerting high lag.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]