diff options
author | Alex Auvolat <alex@adnab.me> | 2023-11-09 14:53:34 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-11-09 14:53:34 +0100 |
commit | 94caf9c0c1342ce1d2ba3ac7af39fb133721ee83 (patch) | |
tree | b1ac2bff79fb0f05256f0636e2272442c7994b6d /src/rpc/system.rs | |
parent | bfb1845fdc981a370539d641a5d80f438f184f07 (diff) | |
download | garage-94caf9c0c1342ce1d2ba3ac7af39fb133721ee83.tar.gz garage-94caf9c0c1342ce1d2ba3ac7af39fb133721ee83.zip |
layout: separate code path for synchronizing update trackers only
Diffstat (limited to 'src/rpc/system.rs')
-rw-r--r-- | src/rpc/system.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/rpc/system.rs b/src/rpc/system.rs index cb3af3fe..6ce13d0d 100644 --- a/src/rpc/system.rs +++ b/src/rpc/system.rs @@ -34,7 +34,7 @@ use crate::consul::ConsulDiscovery; #[cfg(feature = "kubernetes-discovery")] use crate::kubernetes::*; use crate::layout::manager::{LayoutManager, LayoutStatus}; -use crate::layout::*; +use crate::layout::{self, LayoutHistory, NodeRoleV}; use crate::replication_mode::*; use crate::rpc_helper::*; @@ -65,10 +65,15 @@ pub enum SystemRpc { GetKnownNodes, /// Return known nodes ReturnKnownNodes(Vec<KnownNodeInfo>), + /// Ask other node its cluster layout. Answered with AdvertiseClusterLayout PullClusterLayout, /// Advertisement of cluster layout. Sent spontanously or in response to PullClusterLayout AdvertiseClusterLayout(LayoutHistory), + /// Ask other node its cluster layout update trackers. + PullClusterLayoutTrackers, + /// Advertisement of cluster layout update trackers. + AdvertiseClusterLayoutTrackers(layout::UpdateTrackers), } impl Rpc for SystemRpc { @@ -727,6 +732,14 @@ impl EndpointHandler<SystemRpc> for System { .handle_advertise_cluster_layout(adv) .await } + SystemRpc::PullClusterLayoutTrackers => { + Ok(self.layout_manager.handle_pull_cluster_layout_trackers()) + } + SystemRpc::AdvertiseClusterLayoutTrackers(adv) => { + self.layout_manager + .handle_advertise_cluster_layout_trackers(adv) + .await + } // ---- other -> Error ---- m => Err(Error::unexpected_rpc_message(m)), |