apache / druid

Apache Druid: a high performance real-time analytics database.
https://druid.apache.org/
Apache License 2.0
13.52k stars 3.71k forks source link

DruidOverlord: Move becomeLeader/stopBeingLeader earlier. #17415

Closed gianm closed 3 weeks ago

gianm commented 4 weeks ago

On becoming leader, it is helpful for the TaskRunner and TaskQueue to be available when the SupervisorManager starts up, to aid the supervisors in discovering their tasks.

On stopping leadership, it is helpful for the TaskRunner and TaskQueue to be available until the SupervisorManager has finished shutting down.

To achieve this, this patch splits the TaskMaster leader concept into "half leader" (queue and runner only) and "full leader" (queue, runner, and supervisor manager). The TaskMaster becomes half leader while the SupervisorManager is starting or stopping; full leader while the SupervisorManager is running.