kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

[NEW] Support min-slaves-to-write like redis

Open ShooterIT opened this issue 4 years ago • 0 comments

The problem/use-case that the feature addresses

Redis provide these configs to make it is possible for a master to stop accepting writes if there are less than N replicas connected, having a lag less or equal than M seconds. But kvrocks can't.

min-replicas-to-write 3 min-replicas-max-lag 10

Description of the feature

The N replicas need to be in "online" state.

The lag in seconds, that must be <= the specified value, is calculated from the last ping received from the replica, that is usually sent every second.

This option does not GUARANTEE that N replicas will accept the write, but will limit the window of exposure for lost writes in case not enough replicas are available, to the specified number of seconds.

Alternatives you've considered

We may want to support semi-sync like MySQL, so we should also think it is worth implementing this feature.

Additional information

NULL

ShooterIT avatar Dec 30 '21 06:12 ShooterIT