diff options
author | Alex Auvolat <alex@adnab.me> | 2021-03-16 11:14:27 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-03-16 11:14:27 +0100 |
commit | 1d9961e4118af0e26068e1d6c5c6c009a1292a88 (patch) | |
tree | e05bc162772e8c4a5bd658f437de02108b55c5a2 /src/table/sync.rs | |
parent | 6a8439fd1345ecae7414386f76dda7a03eb14df2 (diff) | |
download | garage-1d9961e4118af0e26068e1d6c5c6c009a1292a88.tar.gz garage-1d9961e4118af0e26068e1d6c5c6c009a1292a88.zip |
Simplify replication logic
Diffstat (limited to 'src/table/sync.rs')
-rw-r--r-- | src/table/sync.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/table/sync.rs b/src/table/sync.rs index f8fef53c..ac0305e2 100644 --- a/src/table/sync.rs +++ b/src/table/sync.rs @@ -218,10 +218,7 @@ where let nodes = self .aux .replication - .write_nodes( - &hash_of_merkle_partition(partition.range.begin), - &self.aux.system, - ) + .write_nodes(&hash_of_merkle_partition(partition.range.begin)) .into_iter() .filter(|node| *node != my_id) .collect::<Vec<_>>(); @@ -293,7 +290,7 @@ where let nodes = self .aux .replication - .write_nodes(&begin, &self.aux.system) + .write_nodes(&begin) .into_iter() .collect::<Vec<_>>(); if nodes.contains(&self.aux.system.id) { @@ -303,7 +300,7 @@ where ); break; } - if nodes.len() < self.aux.replication.write_quorum(&self.aux.system) { + if nodes.len() < self.aux.replication.write_quorum() { return Err(Error::Message(format!( "Not offloading as we don't have a quorum of nodes to write to." ))); @@ -616,7 +613,7 @@ impl SyncTodo { let begin_hash = hash_of_merkle_partition(begin); let end_hash = hash_of_merkle_partition_opt(end); - let nodes = aux.replication.replication_nodes(&begin_hash, &ring); + let nodes = aux.replication.write_nodes(&begin_hash); let retain = nodes.contains(&my_id); if !retain { |