Skip to content

Commit f675f4e

Browse files
authored
Merge pull request #37 from lichuang/lichuang_refactor
update tool chain version
2 parents 394c417 + cd5a570 commit f675f4e

10 files changed

+13
-16
lines changed

async-raft/src/core/admin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ impl<'a, D: AppData, R: AppDataResponse, N: RaftNetwork<D>, S: RaftStorage<D, R>
165165

166166
// TODO(xp): 111 test adding a node that is not non-voter.
167167
// TODO(xp): 111 test adding a node that is lagging.
168-
for new_node in members.difference(&self.core.effective_membership.membership.get_ith_config(0).unwrap()) {
169-
match self.nodes.get(&new_node) {
168+
for new_node in members.difference(self.core.effective_membership.membership.get_ith_config(0).unwrap()) {
169+
match self.nodes.get(new_node) {
170170
// Node is ready to join.
171171
Some(node) => {
172172
if node.is_line_rate(&self.core.last_log_id, &self.core.config) {

async-raft/src/core/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ impl<'a, D: AppData, R: AppDataResponse, N: RaftNetwork<D>, S: RaftStorage<D, R>
296296
pub(super) async fn client_request_post_commit(&mut self, req: ClientRequestEntry<D, R>) {
297297
let entry = &req.entry;
298298

299-
let apply_res = self.apply_entry_to_state_machine(&entry).await;
299+
let apply_res = self.apply_entry_to_state_machine(entry).await;
300300

301301
self.send_response(entry, apply_res, req.tx).await;
302302

async-raft/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![doc = include_str!("../README.md")]
22
#![feature(backtrace)]
3-
#![feature(bound_cloned)]
43

54
pub mod config;
65
mod core;

async-raft/src/raft.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,7 @@ impl Membership {
759759
Membership::new_single(btreeset! {id})
760760
}
761761

762+
#[must_use]
762763
pub fn to_final_config(&self) -> Self {
763764
assert!(!self.configs.is_empty());
764765

async-raft/tests/add_remove_voter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,15 @@ async fn wait_log(router: std::sync::Arc<fixtures::RaftRouter>, node_ids: &BTree
135135
for i in node_ids.iter() {
136136
router
137137
.wait_for_metrics(
138-
&i,
138+
i,
139139
|x| x.last_log_index == want_log,
140140
Some(timeout),
141141
&format!("n{}.last_log_index -> {}", i, want_log),
142142
)
143143
.await?;
144144
router
145145
.wait_for_metrics(
146-
&i,
146+
i,
147147
|x| x.last_applied == want_log,
148148
Some(timeout),
149149
&format!("n{}.last_applied -> {}", i, want_log),

async-raft/tests/concurrent_write_and_add_non_voter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ async fn wait_log(
143143
for i in node_ids.iter() {
144144
router
145145
.wait_for_metrics(
146-
&i,
146+
i,
147147
|x| x.last_log_index == want_log,
148148
Some(timeout),
149149
&format!("n{}.last_log_index -> {}", i, want_log),
150150
)
151151
.await?;
152152
router
153153
.wait_for_metrics(
154-
&i,
154+
i,
155155
|x| x.last_applied == want_log,
156156
Some(timeout),
157157
&format!("n{}.last_applied -> {}", i, want_log),

async-raft/tests/membership/t30_commit_joint_config.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@ async fn commit_joint_config_during_0_to_012() -> Result<()> {
2626
let router = Arc::new(RaftRouter::new(config.clone()));
2727
router.new_raft_node(0).await;
2828

29-
// Assert all nodes are in non-voter state & have no entries.
30-
let want;
31-
3229
// router.assert_pristine_cluster().await;
3330

3431
// Initialize the cluster, then assert that a stable cluster was formed & held.
3532
tracing::info!("--- initializing cluster");
3633
router.initialize_from_single_node(0).await?;
37-
want = 1;
34+
// Assert all nodes are in non-voter state & have no entries.
35+
let want = 1;
3836

3937
router.wait_for_log(&btreeset![0], want, None, "init node 0").await?;
4038

async-raft/tests/membership/t40_removed_follower.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async fn stop_replication_to_removed_follower() -> Result<()> {
5050

5151
for i in &[0, 3, 4] {
5252
router
53-
.wait(&i, timeout())
53+
.wait(i, timeout())
5454
.await?
5555
.metrics(|x| x.last_applied >= n_logs, "new cluster recv new logs")
5656
.await?;
@@ -59,7 +59,7 @@ async fn stop_replication_to_removed_follower() -> Result<()> {
5959

6060
for i in &[1, 2] {
6161
router
62-
.wait(&i, timeout())
62+
.wait(i, timeout())
6363
.await?
6464
.metrics(|x| x.last_applied < n_logs, "old cluster does not recv new logs")
6565
.await?;

memstore/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![doc = include_str!("../README.md")]
22
#![feature(backtrace)]
3-
#![feature(bound_cloned)]
43

54
#[cfg(test)]
65
mod test;

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2021-06-01
1+
nightly-2021-12-30

0 commit comments

Comments
 (0)