sajjad-moradi commented on a change in pull request #7267:
URL: https://github.com/apache/pinot/pull/7267#discussion_r712390764



##########
File path: 
pinot-common/src/main/java/org/apache/pinot/common/utils/ServiceStatus.java
##########
@@ -236,13 +242,27 @@ public synchronized Status getServiceStatus() {
         return _serviceStatus;
       }
       long now = System.currentTimeMillis();
-      if (now < _endWaitTime) {
-        _statusDescription =
-            String.format("Waiting for consuming segments to catchup, 
timeRemaining=%dms", _endWaitTime - now);
-        return Status.STARTING;
+      int numConsumingSegmentsNotCaughtUp = 
_getNumConsumingSegmentsNotReachedTheirLatestOffset.get();
+      if (now >= _endWaitTime) {
+        _statusDescription = String.format("Consuming segments status GOOD 
since %dms "
+            + "(numConsumingSegmentsNotCaughtUp=%d)", _endWaitTime, 
numConsumingSegmentsNotCaughtUp);
+        return Status.GOOD;
       }
-      _statusDescription = String.format("Consuming segments status GOOD since 
%dms", _endWaitTime);
-      return Status.GOOD;
+      if (_consumptionNotYetCaughtUp && numConsumingSegmentsNotCaughtUp > 0) {
+        // TODO: Once the performance of offset based consumption checker is 
validated:
+        //      - remove the log line
+        //      - uncomment the status & statusDescription lines
+        //      - remove variable _consumptionNotYetCaughtUp
+        _consumptionNotYetCaughtUp = false;
+        LOGGER.info("All consuming segments have reached their latest offsets! 
"
+            + "Finished {} msec earlier than time threshold.", _endWaitTime - 
now);
+//      _statusDescription = "Consuming segments status GOOD as all consuming 
segments have reached the latest offset";
+//      return Status.GOOD;

Review comment:
       We'll uncomment this part after we analyzed the performance of the new 
status checker. It's explained in the TODO part a few lines above.




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