aho135 commented on code in PR #20387:
URL: https://github.com/apache/druid/pull/20387#discussion_r4076593343


##########
indexing-service/src/test/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisorStateTest.java:
##########
@@ -2961,6 +2961,115 @@ public void 
testComputeUnassignedServerPriorities_whenMultipleReplicasPerPriorit
     verifyAll();
   }
 
+  /**
+   * In bounded mode, a task group that has already reached its end offsets 
must not have replacement replicas
+   * created for it. Without the guard in {@code createNewTasks()}'s replica 
top-up loop, {@code replicas > tasks}
+   * would submit a replacement replica whose start offset is already at the 
bounded end, so it completes instantly
+   * and re-triggers the top-up, churning tasks endlessly. This test flows 
through {@code runInternal()} and asserts
+   * that no top-up task is submitted; it fails if the guard is removed.
+   */
+  @Test
+  public void testCreateNewTasks_boundedGroupReachedEnd_doesNotTopUpReplicas()
+  {
+    // replicas = 2, taskCount = 1, bounded with an empty range (start == end) 
so the group has reached its end.
+    final BoundedStreamConfig boundedConfig = new BoundedStreamConfig(

Review Comment:
   Good point — the empty-range shortcut wasn't exercising the metadata path 
that's the actual failure mode. Updated in 15be7a6e8c to use a non-empty 
configured range [0, 100) with the metadata store returning committed offsets 
at the end plus a matching bounded config, so the test now drives 
hasTaskGroupReachedBoundedEnd()'s metadata-offset branch (config match + 
currentOffsets >= end). Verified it still fails without the guard.



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