[NEW] Support min-slaves-to-write like redis
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