aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/system.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-11-08 14:23:08 +0100
committerAlex Auvolat <alex@adnab.me>2022-11-08 14:58:39 +0100
commitd75b37b018fc0ce8e3832c8531d9556ff7a345c9 (patch)
treebb458446bd8bc8c098beedbebbd4cbefb7359724 /src/rpc/system.rs
parent73a4ca8b1515f95bf7860fc292c12db83d3c6228 (diff)
downloadgarage-d75b37b018fc0ce8e3832c8531d9556ff7a345c9.tar.gz
garage-d75b37b018fc0ce8e3832c8531d9556ff7a345c9.zip
Return more info when layout's .check() fails, fix compilation, fix test
Diffstat (limited to 'src/rpc/system.rs')
-rw-r--r--src/rpc/system.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rpc/system.rs b/src/rpc/system.rs
index d6576f20..224fbabb 100644
--- a/src/rpc/system.rs
+++ b/src/rpc/system.rs
@@ -565,9 +565,9 @@ impl System {
let update_ring = self.update_ring.lock().await;
let mut layout: ClusterLayout = self.ring.borrow().layout.clone();
- let prev_layout_check = layout.check();
+ let prev_layout_check = layout.check().is_ok();
if layout.merge(adv) {
- if prev_layout_check && !layout.check() {
+ if prev_layout_check && !layout.check().is_ok() {
error!("New cluster layout is invalid, discarding.");
return Err(Error::Message(
"New cluster layout is invalid, discarding.".into(),
@@ -620,7 +620,7 @@ impl System {
async fn discovery_loop(self: &Arc<Self>, mut stop_signal: watch::Receiver<bool>) {
while !*stop_signal.borrow() {
- let not_configured = !self.ring.borrow().layout.check();
+ let not_configured = !self.ring.borrow().layout.check().is_ok();
let no_peers = self.fullmesh.get_peer_list().len() < self.replication_factor;
let expected_n_nodes = self.ring.borrow().layout.num_nodes();
let bad_peers = self