line / line/centraldogma

Two leaders get selected after leader election

Open
#560 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

defect
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.