apache / apache/kvrocks

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

Open
#439 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
4.4k
Forks
658
Avg merge
1d 20h
Merged PRs (30d)
10

Description

**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_

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no files, tests, or entry points. Start by reviewing how replica online state, replica pings, and write acceptance are currently handled. Done means writes are rejected when fewer than the configured number of sufficiently recent replicas are online, with Redis-compatible min-replicas-to-write and min-replicas-max-lag behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, redis
Domain
databases, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.