Skip to content

extend commit group to learners - #566

Open
lance6716 wants to merge 1 commit into
tikv:masterfrom
lance6716:commit-group-learner
Open

extend commit group to learners#566
lance6716 wants to merge 1 commit into
tikv:masterfrom
lance6716:commit-group-learner

Conversation

@lance6716

@lance6716 lance6716 commented Aug 22, 2025

Copy link
Copy Markdown
Contributor

extend commit group to learners. When make sure the group commit rule "raft log should be replicated to at least 2 group", also consider learners.

This feature is used to implement replication across DC by raft learner. Different with existing commit group which check followers, learner has less impact on leader&follower group like a TiFlash replica. It won't affect votes and won't elect itself as leader. Adding commit group for learner can switch between RPO=0 and better performance replication.

Signed-off-by: lance6716 <lance6716@gmail.com>

change style

Signed-off-by: lance6716 <lance6716@gmail.com>

address comment

Signed-off-by: lance6716 <lance6716@gmail.com>

skip broken CI on windows

Signed-off-by: tianyuan <tianyuan@pingcap.cn>

try to upgrade protobuf version

Signed-off-by: lance6716 <lance6716@gmail.com>

rebase

try

Signed-off-by: lance6716 <lance6716@gmail.com>

try

Signed-off-by: lance6716 <lance6716@gmail.com>

add back windows CI

Signed-off-by: lance6716 <lance6716@gmail.com>

refine function comment

Signed-off-by: tianyuan <tianyuan@pingcap.cn>

add a test case

Signed-off-by: tianyuan <tianyuan@pingcap.cn>

don't change github ci.yml

Signed-off-by: tianyuan <tianyuan@pingcap.cn>

change impl

Signed-off-by: tianyuan <tianyuan@pingcap.cn>

address comment

Signed-off-by: tianyuan <tianyuan@pingcap.cn>

refine comment

Signed-off-by: tianyuan <tianyuan@pingcap.cn>

refine code

Signed-off-by: tianyuan <tianyuan@pingcap.cn>

address comment

Signed-off-by: tianyuan <tianyuan@pingcap.cn>

change behaviour for group ID 0

Signed-off-by: tianyuan <tianyuan@pingcap.cn>

refine code

Signed-off-by: lance6716 <lance6716@gmail.com>
@lance6716 lance6716 changed the title add group_commit_for_learner_only extend commit group to learners Aug 22, 2025
@lance6716

Copy link
Copy Markdown
Contributor Author

@BusyJay PTAL

@BusyJay

BusyJay commented Aug 22, 2025

Copy link
Copy Markdown
Member

I don't see why this feature matters. The point of group commit is to ensure latest changes are replicated to different AZs, so if one AZ is down, the new leader can still have all the changes. So what't the point of considering learner here?

@lance6716

lance6716 commented Aug 22, 2025

Copy link
Copy Markdown
Contributor Author

I don't see why this feature matters. The point of group commit is to ensure latest changes are replicated to different AZs, so if one AZ is down, the new leader can still have all the changes. So what't the point of considering learner here?

We only have learners (no voters) in the second AZ. And that learner is a special role like TiFlash, it can't be elected to leaders (It's not like a pre-voter role). The background is very complex and not aimed to be open-source 😂 Do you mind if we have a discussion elsewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants