Skip to content

[Fix-18197][Master] Fix master failover releasing wrong lock path#18207

Merged
ruanwenjun merged 1 commit into
apache:devfrom
ruanwenjun:dev_wenjun_fix18197
May 1, 2026
Merged

[Fix-18197][Master] Fix master failover releasing wrong lock path#18207
ruanwenjun merged 1 commit into
apache:devfrom
ruanwenjun:dev_wenjun_fix18197

Conversation

@ruanwenjun
Copy link
Copy Markdown
Member

Was this PR generated or assisted by AI?

YES, generated by ops 4.7

Purpose of the pull request

close #18197

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

Pull Request Notice

Pull Request Notice

If your pull request contains incompatible change, you should also add it to docs/docs/en/guide/upgrade/incompatible.md

@ruanwenjun ruanwenjun force-pushed the dev_wenjun_fix18197 branch from 619b9fc to 23cfcf7 Compare May 1, 2026 06:54
@ruanwenjun ruanwenjun added the bug Something isn't working label May 1, 2026
@ruanwenjun ruanwenjun added this to the 3.4.2 milestone May 1, 2026
Copy link
Copy Markdown
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

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

LGTM

The per-master failover lock was acquired at
/lock/master-failover/<masterAddress> but released at the parent path
/lock/master-failover, so the per-master lock node was never released
and blocked subsequent failover from peer masters.

* RegistryClient#getLock now returns an AutoCloseable RegistryLock,
  enforcing acquire/release symmetry via try-with-resources.
* RegistryClient#releaseLock(String) is removed; callers use the
  returned handle.
* FailoverCoordinator#doMasterFailover stores the lock path in a local
  variable and uses try-with-resources.
@ruanwenjun ruanwenjun force-pushed the dev_wenjun_fix18197 branch from 23cfcf7 to 7438246 Compare May 1, 2026 14:23
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 1, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 60%)

See analysis details on SonarQube Cloud

@ruanwenjun ruanwenjun merged commit 710236b into apache:dev May 1, 2026
120 of 122 checks passed
@ruanwenjun ruanwenjun deleted the dev_wenjun_fix18197 branch May 1, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [Master] Master failover lock path mismatch between getLock and releaseLock

2 participants