Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Probe from index less than match #555

Closed
wego1236 opened this issue Nov 14, 2024 · 3 comments
Closed

Probe from index less than match #555

wego1236 opened this issue Nov 14, 2024 · 3 comments

Comments

@wego1236
Copy link
Contributor

In probe mechanism there is chance for replication starting from an index less than match index in probe state, unlike that in replicate state. For example, a rejected probe response got delayed and is received when the leader falls into another probe state. This is a rare case of cause.

To my understanding, allowing such a smaller index implies we want to tolerate loss of already replicated log entries.
raft-rs/src/tracker/progress.rs

        if request_snapshot == INVALID_INDEX {
            self.next_idx = cmp::min(rejected, match_hint + 1);
            if self.next_idx < 1 {
                self.next_idx = 1;
            }

In this code, there is chance to make Next < Match. But the invariant in raft is that Next > Match.

@wego1236
Copy link
Contributor Author

i also find in etcd it fix this bug in https://github.com/etcd-io/raft/pull/149

@BusyJay
Copy link
Member

BusyJay commented Nov 14, 2024

Good catch! Do you want to port the patch?

@wego1236
Copy link
Contributor Author

Yes,i'll do it right now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants