centraldogma
centraldogma copied to clipboard
Two leaders get selected after leader election
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