New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HA: Disable replication from old main #1674
HA: Disable replication from old main #1674
Conversation
ab1943f
to
b4082a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, however I would spend some time in making code more consistent and readable 💪
53ec7cb
to
d3bfd26
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💪
22359da
to
82c4eb8
Compare
@kgolubic RN: REPLICAs now listen only to one MAIN instance. When using replication as part of high availability, coordinator orchestrates which instance is REPLICA listening to. When using only replication without HA, main sends its ID to each REPLICA which REPLICA listens to. |
The goal of this PR is to disable replication from the old main once it comes back up. We are introducing uuid as a discriminating factor between databases (not just storages but whole databases). When the old main dies, we first swap uuid and set it to uuid of the new main, then we proceed with failover to avoid the old main still replicating data to the instance.
The coordinator will now be the owner of the information of the main uuid. This means the coordinator will generate uuid and send it to the main on PromoteReplicaToMainRpc.
In regular replication without a coordinator, each time a replica is registered, the main will send its own id.
TODO:
[master < Task] PR
To keep docs changelog up to date, one more thing to do: