Reputation: 4483
I'm reading the strong consistency mode for aerospike manual. In the last example "Strong Consistency for reads", they explain that in case of a partition, they need a concept called "regime" to ensure linearization of reads. Why do we need that? writes to the minority would not succeed, as they won't be replicated, so what are we worrying about? missing writes to the active master?
Upvotes: 2
Views: 202
Reputation: 2768
It boils down to the fact that when the cluster partitions, all nodes likely do not partition simultaneously.
Consider a single data-partition (shard) of Aerospike. The master copy from the prior regime is on the minority side of the partition without all of its replicas then it needs to give up being master while a copy in the new regime needs to promote to master. Since we are in a network partition, these two nodes cannot coordinate this exchange. The master from the prior regime may receive a read before determining it's no longer master. To ensure a linearized read, the read-transaction issues a replica ping which includes the current regime the master believes it is on. If any replica reports that the regime has advanced then the read fails, otherwise the replica-ping allows the transaction to proceed.
If any new write were able to complete on the new regime then based on the liveliness rules, it is ensured that any linearized read against the old regime will fail.
Upvotes: 3