Skip to content

feat: separate worker disabled state from worker version#19448

Open
jtuglu1 wants to merge 1 commit into
apache:masterfrom
jtuglu1:separate-disabled-flag-from-worker-version
Open

feat: separate worker disabled state from worker version#19448
jtuglu1 wants to merge 1 commit into
apache:masterfrom
jtuglu1:separate-disabled-flag-from-worker-version

Conversation

@jtuglu1
Copy link
Copy Markdown
Contributor

@jtuglu1 jtuglu1 commented May 11, 2026

Description

Currently, to disable a worker (MM/Indexer), you need to set the version as "". This is not ideal, as it's difficult to see a) what version a disabled worker is and b) write any logic to perform scaling around multi-version worker deployments (for example during a rolling upgrade).

This ensures the disabled state is tracked separately from the worker version. The change is backwards compatible (to not break existing deployments) and can then be migrated to simply relying on the disabled flag in a subsequent release.

Release note

Track the worker enabled state separately from the worker version.


This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@jtuglu1 jtuglu1 force-pushed the separate-disabled-flag-from-worker-version branch from 313e2b8 to dfb03f5 Compare May 11, 2026 18:39
@jtuglu1 jtuglu1 force-pushed the separate-disabled-flag-from-worker-version branch from dfb03f5 to b8655f2 Compare May 11, 2026 19:14
@jtuglu1 jtuglu1 requested review from abhishekrb19 and maytasm May 11, 2026 19:30
Copy link
Copy Markdown
Member

@FrankChen021 FrankChen021 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed the code for correctness, edge cases, concurrency, and integration risks; no issues found.

Reviewed 10 of 10 changed files.


This is an automated review by Codex GPT-5.5

Copy link
Copy Markdown
Contributor

@abhishekrb19 abhishekrb19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, left some minor comments.

Comment thread indexing-service/src/main/java/org/apache/druid/indexing/overlord/ZkWorker.java Outdated
@jtuglu1 jtuglu1 force-pushed the separate-disabled-flag-from-worker-version branch from b8655f2 to 0a105a7 Compare May 12, 2026 19:40
Copy link
Copy Markdown
Member

@FrankChen021 FrankChen021 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity Findings
P0 0
P1 0
P2 1
P3 0
Total 1

Reviewed 10 of 10 changed files.


This is an automated review by Codex GPT-5.5

if (w.isDisabled() == disabled) {
return w;
}
return new Worker(w.getScheme(), w.getHost(), w.getIp(), w.getCapacity(), w.getVersion(), w.getCategory(), disabled);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Update console disabled checks for preserved worker versions

This now builds the disabled HRTR Worker with its real version instead of the legacy empty string, so /druid/indexer/v1/workers can serialize disabled workers as { disabled: true, version: "v1" }. The web console still checks worker.version === '' in services-view.tsx for both the Disabled label and Enable/Disable action selection, so HRTR-disabled workers will appear enabled and the UI will offer Disable instead of Enable. Update the console WorkerInfo type and checks to use worker.disabled, with version === '' retained as a legacy fallback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants