diff options
author | Alex Auvolat <alex@adnab.me> | 2023-12-07 10:30:26 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-12-07 10:30:26 +0100 |
commit | c8356a91d9bf1d1488ec288099f2a55a1019918f (patch) | |
tree | 1782fc08ed6b2c6b6813c8c617d1be564e9229e9 /src/rpc/layout/history.rs | |
parent | c04dd8788a3764da2f307b1d10c2d56b7b0e4a61 (diff) | |
download | garage-c8356a91d9bf1d1488ec288099f2a55a1019918f.tar.gz garage-c8356a91d9bf1d1488ec288099f2a55a1019918f.zip |
layout updates: fix the set of nodes among which minima are calculated
Diffstat (limited to 'src/rpc/layout/history.rs')
-rw-r--r-- | src/rpc/layout/history.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rpc/layout/history.rs b/src/rpc/layout/history.rs index 7d4a1b48..c448ac24 100644 --- a/src/rpc/layout/history.rs +++ b/src/rpc/layout/history.rs @@ -77,14 +77,16 @@ impl LayoutHistory { } // If there are old versions that no one is reading from anymore, - // remove them + // remove them (keep them in self.old_versions). + // ASSUMPTION: we only care about where nodes in the current layout version + // are reading from, as we assume older nodes are being discarded. while self.versions.len() > 1 { - let all_nongateway_nodes = self.get_all_nongateway_nodes(); + let current_nodes = &self.current().node_id_vec; let min_version = self.min_stored(); let sync_ack_map_min = self .update_trackers .sync_ack_map - .min(&all_nongateway_nodes, min_version); + .min_among(¤t_nodes, min_version); if self.min_stored() < sync_ack_map_min { let removed = self.versions.remove(0); info!( |