Skip to content

Commit

Permalink
chore: add cluster version check
Browse files Browse the repository at this point in the history
Signed-off-by: iGxnon <igxnon@gmail.com>
  • Loading branch information
iGxnon committed Dec 29, 2023
1 parent 3883c81 commit 61e373b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions curp/src/members.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::{
use dashmap::{mapref::one::Ref, DashMap};
use futures::{stream::FuturesUnordered, StreamExt};
use itertools::Itertools;
use tracing::debug;
use tracing::{debug, info};

use crate::rpc::{self, FetchClusterRequest, FetchClusterResponse, Member};

Expand Down Expand Up @@ -297,7 +297,7 @@ impl ClusterInfo {
addrs.hash(&mut hasher);
});
let ver = hasher.finish();
debug!("cluster version updates to {ver}");
info!("cluster version updates to {ver}");
self.cluster_version.store(ver, Ordering::Relaxed);
}

Expand Down
4 changes: 4 additions & 0 deletions curp/src/server/raw_curp/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,10 @@ fn add_node_should_add_new_node_to_curp() {
old_cluster.all_members(),
cluster_after_fallback.all_members()
);
assert_eq!(
cluster_after_fallback.cluster_version(),
old_cluster.cluster_version()
);
}

#[traced_test]
Expand Down

0 comments on commit 61e373b

Please sign in to comment.