diff options
author | Alex Auvolat <alex@adnab.me> | 2023-11-09 14:12:05 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-11-09 14:12:05 +0100 |
commit | bfb1845fdc981a370539d641a5d80f438f184f07 (patch) | |
tree | 180ec9bf0e6bdf4148c80304fd48c22d92cdcc10 /src/model/helper | |
parent | 19ef1ec8e7fee3a6c670e6e35dfcc83f0801e604 (diff) | |
download | garage-bfb1845fdc981a370539d641a5d80f438f184f07.tar.gz garage-bfb1845fdc981a370539d641a5d80f438f184f07.zip |
layout: refactor to use a RwLock on LayoutHistory
Diffstat (limited to 'src/model/helper')
-rw-r--r-- | src/model/helper/bucket.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/model/helper/bucket.rs b/src/model/helper/bucket.rs index 18904c8d..2a9c0fb1 100644 --- a/src/model/helper/bucket.rs +++ b/src/model/helper/bucket.rs @@ -450,10 +450,8 @@ impl<'a> BucketHelper<'a> { #[cfg(feature = "k2v")] { - use garage_rpc::layout::LayoutHistory; - use std::sync::Arc; - - let layout: Arc<LayoutHistory> = self.0.system.cluster_layout().clone(); + // TODO: not only current + let node_id_vec = self.0.system.cluster_layout().current().node_ids().to_vec(); let k2vindexes = self .0 .k2v @@ -462,10 +460,7 @@ impl<'a> BucketHelper<'a> { .get_range( &bucket_id, None, - Some(( - DeletedFilter::NotDeleted, - layout.current().node_id_vec.clone(), - )), + Some((DeletedFilter::NotDeleted, node_id_vec)), 10, EnumerationOrder::Forward, ) |