FrankChen021 commented on code in PR #19700:
URL: https://github.com/apache/druid/pull/19700#discussion_r3614171309
##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManager.java:
##########
@@ -663,7 +673,7 @@ private SupervisorSpec
possiblyStopAndRemoveSupervisorInternal(String id, boolea
new NoopSupervisorSpec(null, pair.rhs.getDataSources())
); // where NoopSupervisorSpec is a tombstone
}
- pair.lhs.stop(true);
+ pair.lhs.stop(terminateTasks);
Review Comment:
Thanks. I agree that autoscaling should remain enabled after the restart,
but that is separate from allowing a queued decision owned by the old
supervisor to run while that supervisor is already `STOPPING`.
`DynamicAllocationTasksNotice` calls `changeTaskCount()`, which calls
`gracefulShutdownInternal()` and rolls the existing tasks to publishing—the
exact disruption that `RESTART_SUPERVISOR` / `stop(false)` is intended to avoid.
The manager stops and discards the old autoscaler immediately after `stop()`
returns and creates a new autoscaler for the replacement supervisor. Ignoring
old-supervisor allocation notices once `STOPPING` is set therefore does not
disable future autoscaling; it only prevents stale notices from acting during
the handoff. Stopping the autoscaler first narrows the window, but a notice may
already be queued, so please also make `DynamicAllocationTasksNotice` return
early when `isStopping()` and cover that ordering with a test.
Reviewed 10 of 10 changed files.
--
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]