adithyachakilam commented on code in PR #16844:
URL: https://github.com/apache/druid/pull/16844#discussion_r1709774390


##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -3616,8 +3616,26 @@ private void checkIfStreamInactiveAndTurnSupervisorIdle()
       return;
     }
 
-    Map<PartitionIdType, SequenceOffsetType> latestSequencesFromStream = 
getLatestSequencesFromStream();
     final long nowTime = DateTimes.nowUtc().getMillis();
+    // if it is the first run and there is no lag observed when compared to 
the offsets from metadata storage stay idle
+    if (!stateManager.isAtLeastOneSuccessfulRun()) {
+      lastActiveTimeMillis = nowTime;
+      Map<PartitionIdType, SequenceOffsetType> comittedOffsets = 
getOffsetsFromMetadataStorage();
+      if (comittedOffsets.isEmpty()) {
+        // since there is no previous offsets info available we can skip 
checking for idleness
+        return;
+      }
+
+      updatePartitionLagFromStream();
+      Map<PartitionIdType, SequenceOffsetType> latestSequencesFromStream = 
getLatestSequencesFromStream();
+      if (comittedOffsets.equals(latestSequencesFromStream)) {
+        stateManager.maybeSetState(SupervisorStateManager.BasicState.IDLE);
+        previousSequencesFromStream.putAll(comittedOffsets);
+      }
+      return;

Review Comment:
   Done.



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

Reply via email to