EncryptedCamel
EncryptedCamel

Reputation: 302

Passive Replication in Distributed Systems - Replacing the Primary Server

In a passive replication based distributed system, if the primary server fails, one of the backups is promoted as primary. However, suppose that the original primary server recovers, then how do we switch back the primary server to it from the current backup?

I was wondering

if the failed primary server recovers, it must be incorporated into the system as a secondary and updated to reflect the most accurate information at the given point of time. To restore it as the primary server, it can be promoted as the primary in case the current primary (which was originally a backup) fails, otherwise, if required the current primary can be blocked for a while, the original primary promoted as primary again and the blocked reintroduced as backup.

I could not find an answer to this question elsewhere and this is what I feel. Please suggest any better alternatives.

Upvotes: 0

Views: 841

Answers (1)

Vervious
Vervious

Reputation: 5569

It depends on what system you're looking at. Usually there's no immediate need to replace the backup when the original primary server recovers; if there is, you'd need to synchronize the two and promote the original primary.

Distributed synchronization (or consensus) is a hard problem. There's a lot of literature out there and I recommend that you read up. An example of a passively replicated system (with Leaders/Followers/Candidates) is Raft, which you could start with. A good online visualization can be found here, and the paper is here.

ZAB and Paxos are worth a read as well!

Upvotes: 1

Related Questions