Skip to content

Conversation

@lance6716
Copy link
Contributor

@lance6716 lance6716 commented Aug 22, 2025

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 <[email protected]>

change style

Signed-off-by: lance6716 <[email protected]>

address comment

Signed-off-by: lance6716 <[email protected]>

skip broken CI on windows

Signed-off-by: tianyuan <[email protected]>

try to upgrade protobuf version

Signed-off-by: lance6716 <[email protected]>

rebase

try

Signed-off-by: lance6716 <[email protected]>

try

Signed-off-by: lance6716 <[email protected]>

add back windows CI

Signed-off-by: lance6716 <[email protected]>

refine function comment

Signed-off-by: tianyuan <[email protected]>

add a test case

Signed-off-by: tianyuan <[email protected]>

don't change github ci.yml

Signed-off-by: tianyuan <[email protected]>

change impl

Signed-off-by: tianyuan <[email protected]>

address comment

Signed-off-by: tianyuan <[email protected]>

refine comment

Signed-off-by: tianyuan <[email protected]>

refine code

Signed-off-by: tianyuan <[email protected]>

address comment

Signed-off-by: tianyuan <[email protected]>

change behaviour for group ID 0

Signed-off-by: tianyuan <[email protected]>

refine code

Signed-off-by: lance6716 <[email protected]>
@lance6716 lance6716 changed the title add group_commit_for_learner_only extend commit group to learners Aug 22, 2025
@lance6716
Copy link
Contributor Author

@BusyJay PTAL

@BusyJay
Copy link
Member

BusyJay commented Aug 22, 2025

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
Copy link
Contributor Author

lance6716 commented Aug 22, 2025

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