Two leaders get selected after leader election
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 668
- Forks
- 135
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 7
Description
After Central Dogma replicas are rolling restart, we found that two replicas have a leadership which was taken by Curator's
Leader Election.
The phenomenon is similar to https://issues.apache.org/jira/browse/CURATOR-47. However, CURATOR-47 was fixed a long time ago.
Alternatively, we can use the server state of embedded ZooKeeper for electing a leader in order to avoid that risky situation.
https://github.com/line/centraldogma/blob/6d18ceaf5ee7d8b724ed38fee4a0f245d35f9ef7/server/src/main/java/com/linecorp/centraldogma/server/internal/replication/EmbeddedZooKeeper.java#L133-L148
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with server/src/main/java/com/linecorp/centraldogma/server/internal/replication/EmbeddedZooKeeper.java at lines 133-148 and the linked Curator leader-election report. Trace leader selection during a rolling restart and compare it with the embedded ZooKeeper server state. Done means a rolling restart cannot leave two replicas recognized as leaders, with the behavior covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100