diff options
author | Yureka <yuka@yuka.dev> | 2024-03-04 19:58:32 +0100 |
---|---|---|
committer | Yureka <yuka@yuka.dev> | 2024-03-07 12:45:33 +0100 |
commit | c1769bbe69f723fb3980cf4fdac7615cfb782720 (patch) | |
tree | e623904bbdc861b42039057d6a1e982486fc60b4 /src/rpc/layout/history.rs | |
parent | 8f86af52ed917bce506989ae1f378d977aa6c3ef (diff) | |
download | garage-c1769bbe69f723fb3980cf4fdac7615cfb782720.tar.gz garage-c1769bbe69f723fb3980cf4fdac7615cfb782720.zip |
ReplicationMode -> ConsistencyMode+ReplicationFactor
Diffstat (limited to 'src/rpc/layout/history.rs')
-rw-r--r-- | src/rpc/layout/history.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rpc/layout/history.rs b/src/rpc/layout/history.rs index b8cc27da..290f058d 100644 --- a/src/rpc/layout/history.rs +++ b/src/rpc/layout/history.rs @@ -6,11 +6,11 @@ use garage_util::encode::nonversioned_encode; use garage_util::error::*; use super::*; -use crate::replication_mode::ReplicationMode; +use crate::replication_mode::*; impl LayoutHistory { - pub fn new(replication_factor: usize) -> Self { - let version = LayoutVersion::new(replication_factor); + pub fn new(replication_factor: ReplicationFactor) -> Self { + let version = LayoutVersion::new(replication_factor.into()); let staging = LayoutStaging { parameters: Lww::<LayoutParameters>::new(version.parameters), @@ -119,7 +119,7 @@ impl LayoutHistory { pub(crate) fn calculate_sync_map_min_with_quorum( &self, - replication_mode: ReplicationMode, + replication_factor: ReplicationFactor, all_nongateway_nodes: &[Uuid], ) -> u64 { // This function calculates the minimum layout version from which @@ -133,7 +133,7 @@ impl LayoutHistory { return self.current().version; } - let quorum = replication_mode.write_quorum(); + let quorum = replication_factor.write_quorum(ConsistencyMode::Consistent); let min_version = self.min_stored(); let global_min = self |