aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/layout/helper.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2024-03-27 13:37:20 +0100
committerAlex Auvolat <alex@adnab.me>2024-03-27 13:37:20 +0100
commit32f1786f9ff17f12911f5f3f37e2d1c35d534f59 (patch)
treea7ae40d9b0f75c8a264734bb3fee314dfe699c25 /src/rpc/layout/helper.rs
parent01a0bd54106941156ca998be1a44b8ac2c3aa74a (diff)
downloadgarage-32f1786f9ff17f12911f5f3f37e2d1c35d534f59.tar.gz
garage-32f1786f9ff17f12911f5f3f37e2d1c35d534f59.zip
[next-0.10] cache layout check result
Diffstat (limited to 'src/rpc/layout/helper.rs')
-rw-r--r--src/rpc/layout/helper.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rpc/layout/helper.rs b/src/rpc/layout/helper.rs
index ddf8fd44..b15f7540 100644
--- a/src/rpc/layout/helper.rs
+++ b/src/rpc/layout/helper.rs
@@ -41,6 +41,7 @@ pub struct LayoutHelper {
trackers_hash: Hash,
staging_hash: Hash,
+ is_check_ok: bool,
// ack lock: counts in-progress write operations for each
// layout version ; we don't increase the ack update tracker
@@ -107,6 +108,8 @@ impl LayoutHelper {
.entry(layout.current().version)
.or_insert(AtomicUsize::new(0));
+ let is_check_ok = layout.check().is_ok();
+
LayoutHelper {
replication_factor,
consistency_mode,
@@ -118,6 +121,7 @@ impl LayoutHelper {
trackers_hash,
staging_hash,
ack_lock,
+ is_check_ok,
}
}
@@ -153,6 +157,10 @@ impl LayoutHelper {
&self.inner().versions
}
+ pub fn is_check_ok(&self) -> bool {
+ self.is_check_ok
+ }
+
/// Return all nodes that have a role (gateway or storage)
/// in one of the currently active layout versions
pub fn all_nodes(&self) -> &[Uuid] {