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

Divide src/progress.rs into mods #188

Merged
merged 12 commits into from
Apr 1, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' of https://github.com/pingcap/raft-rs into issu…
…e125_divide_progress_into_mods

Signed-off-by: Fullstop000 <fullstop1005@gmail.com>

# Conflicts:
#	src/progress/progress_set.rs
#	src/raft.rs
Fullstop000 committed Mar 1, 2019
commit bbf1f9052ef00001b41aeffa232a307070763bcb
15 changes: 15 additions & 0 deletions src/progress/mod.rs
Original file line number Diff line number Diff line change
@@ -233,4 +233,19 @@ impl Progress {
pub fn pause(&mut self) {
self.paused = true;
}

/// Update inflight msgs and next_idx
pub fn update_state(&mut self, last: u64) {
match self.state {
ProgressState::Replicate => {
self.optimistic_update(last);
self.ins.add(last);
}
ProgressState::Probe => self.pause(),
ProgressState::Snapshot => panic!(
"updating progress state in unhandled state {:?}",
self.state
),
}
}
}
1 change: 0 additions & 1 deletion src/progress/progress_set.rs
Original file line number Diff line number Diff line change
@@ -654,7 +654,6 @@ impl ProgressSet {
}
}

#[cfg(test)]
mod test_progress_set {
use super::{Configuration, ProgressSet, Result};
use crate::progress::Progress;
2 changes: 1 addition & 1 deletion src/raft.rs
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ use rand::{self, Rng};
use super::errors::{Error, Result, StorageError};
use super::progress::progress_set::{CandidacyStatus, Configuration, ProgressSet};
use super::progress::{Progress, ProgressState};
use super::raft_log::{self, RaftLog};
use super::raft_log::RaftLog;
use super::read_only::{ReadOnly, ReadOnlyOption, ReadState};
use super::storage::Storage;
use super::Config;
You are viewing a condensed version of this merge commit. You can view the full changes here.