How to allow multiple instances of replicated service to be leader? #56
Unanswered
sixty-two62
asked this question in
Q&A
Replies: 1 comment
|
You are right, it's not possible to enable it through flags alone. It has been disabled in code on purpose. When we need to failover we start another instance with -logsdb-leader I'll work on removing code restriction, test and enabling in our production. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hey, thanks for open-sourcing TernFS! I've been taking a look at the code and doing some testing, and I'm confused on how to start up replicated services like
ternregistryandternshardsuch that more than one instance is allowed to be the leader. It looks liketernrunonly passes-logsdb-leaderto instance 0 for all of the replicated services. If I try to override this and start all instances with-logsdb-leader, I start getting assertion errors.I took a look at the source and found this chunk of code to be odd: https://github.com/XTXMarkets/ternfs/blob/main/cpp/core/LogsDB.cpp#L732-L738. If I'm understanding things,
_noReplicationis true iff-logsdb-no-replicationis passed, and_avoidBeingLeaderis true iff-logsdb-leaderis passed, so it looks like this function will always make any instance started with-logsdb-leaderbehave as if-logsdb-no-replicationwas passed. Am I missing something here?All reactions