diff options
author | Alex <alex@adnab.me> | 2024-03-07 16:32:52 +0000 |
---|---|---|
committer | Alex <alex@adnab.me> | 2024-03-07 16:32:52 +0000 |
commit | 20c0b4ffb2ae8e250068f8bf8001b5811a6bb6f2 (patch) | |
tree | ee7ab2f5eaf862927ef87d43e661557906742cc5 /src/rpc/layout/history.rs | |
parent | 2fd13c7d135949a83ed52ed81672ac7e1956f134 (diff) | |
parent | c1769bbe69f723fb3980cf4fdac7615cfb782720 (diff) | |
download | garage-20c0b4ffb2ae8e250068f8bf8001b5811a6bb6f2.tar.gz garage-20c0b4ffb2ae8e250068f8bf8001b5811a6bb6f2.zip |
Merge pull request 'ReplicationMode -> ConsistencyMode+ReplicationFactor' (#750) from yuka/garage:split-consistency-mode into next-0.10
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/750
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 |