aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/layout/manager.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-11-09 15:52:45 +0100
committerAlex Auvolat <alex@adnab.me>2023-11-09 15:52:45 +0100
commit9d95f6f7040c1899715ae4f984313427b1432758 (patch)
tree9efc076960e3a2304e9d91d4443b08139cc998c0 /src/rpc/layout/manager.rs
parentbad7cc812ead88e9f334405c5c082d79c14c8898 (diff)
downloadgarage-9d95f6f7040c1899715ae4f984313427b1432758.tar.gz
garage-9d95f6f7040c1899715ae4f984313427b1432758.zip
layout: fix tracker bugs
Diffstat (limited to 'src/rpc/layout/manager.rs')
-rw-r--r--src/rpc/layout/manager.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rpc/layout/manager.rs b/src/rpc/layout/manager.rs
index ffcc938b..c1417dac 100644
--- a/src/rpc/layout/manager.rs
+++ b/src/rpc/layout/manager.rs
@@ -125,10 +125,10 @@ impl LayoutManager {
if !prev_layout_check || adv.check().is_ok() {
if layout.merge(adv) {
+ layout.update_trackers(self.node_id);
if prev_layout_check && layout.check().is_err() {
panic!("Merged two correct layouts and got an incorrect layout.");
}
- layout.update_trackers(self.node_id);
return Some(layout.clone());
}
}
@@ -245,6 +245,8 @@ impl LayoutManager {
self: &Arc<Self>,
adv: &LayoutHistory,
) -> Result<SystemRpc, Error> {
+ debug!("handle_advertise_cluster_layout: {:?}", adv);
+
if adv.current().replication_factor != self.replication_factor {
let msg = format!(
"Received a cluster layout from another node with replication factor {}, which is different from what we have in our configuration ({}). Discarding the cluster layout we received.",
@@ -256,6 +258,8 @@ impl LayoutManager {
}
if let Some(new_layout) = self.merge_layout(adv) {
+ debug!("handle_advertise_cluster_layout: some changes were added to the current stuff");
+
self.change_notify.notify_waiters();
self.broadcast_update(SystemRpc::AdvertiseClusterLayout(new_layout));
self.save_cluster_layout().await?;
@@ -268,6 +272,8 @@ impl LayoutManager {
self: &Arc<Self>,
trackers: &UpdateTrackers,
) -> Result<SystemRpc, Error> {
+ debug!("handle_advertise_cluster_layout_trackers: {:?}", trackers);
+
if let Some(new_trackers) = self.merge_layout_trackers(trackers) {
self.change_notify.notify_waiters();
self.broadcast_update(SystemRpc::AdvertiseClusterLayoutTrackers(new_trackers));