diff options
author | Alex Auvolat <alex@adnab.me> | 2021-03-05 15:09:18 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-03-05 15:09:18 +0100 |
commit | 3882d5ba36f48751fdf6e5b82eae0dd990238655 (patch) | |
tree | dbf412ac4643c27617cd613eea04682da25d6a66 /src/table/table.rs | |
parent | d7e148d3027b7092d7de7e561665d2667199e9bc (diff) | |
download | garage-3882d5ba36f48751fdf6e5b82eae0dd990238655.tar.gz garage-3882d5ba36f48751fdf6e5b82eae0dd990238655.zip |
Remove epidemic propagation for fully replicated stuff: write directly to all nodes
Diffstat (limited to 'src/table/table.rs')
-rw-r--r-- | src/table/table.rs | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/table/table.rs b/src/table/table.rs index 8b16173e..1f6b7d25 100644 --- a/src/table/table.rs +++ b/src/table/table.rs @@ -61,9 +61,8 @@ pub trait TableReplication: Send + Sync { // Which nodes to send writes to fn write_nodes(&self, hash: &Hash, system: &System) -> Vec<UUID>; - fn write_quorum(&self) -> usize; + fn write_quorum(&self, system: &System) -> usize; fn max_write_errors(&self) -> usize; - fn epidemic_writes(&self) -> bool; // Which are the nodes that do actually replicate the data fn replication_nodes(&self, hash: &Hash, ring: &Ring) -> Vec<UUID>; @@ -119,7 +118,7 @@ where .try_call_many( &who[..], rpc, - RequestStrategy::with_quorum(self.replication.write_quorum()) + RequestStrategy::with_quorum(self.replication.write_quorum(&self.system)) .with_timeout(TABLE_RPC_TIMEOUT), ) .await?; @@ -382,7 +381,6 @@ where pub async fn handle_update(self: &Arc<Self>, entries: &[Arc<ByteBuf>]) -> Result<(), Error> { let syncer = self.syncer.load_full().unwrap(); - let mut epidemic_propagate = vec![]; for update_bytes in entries.iter() { let update = self.decode_entry(update_bytes.as_slice())?; @@ -410,22 +408,11 @@ where })?; if old_entry.as_ref() != Some(&new_entry) { - if self.replication.epidemic_writes() { - epidemic_propagate.push(new_entry.clone()); - } - self.instance.updated(old_entry, Some(new_entry)); syncer.invalidate(&tree_key[..]); } } - if epidemic_propagate.len() > 0 { - let self2 = self.clone(); - self.system - .background - .spawn_cancellable(async move { self2.insert_many(&epidemic_propagate[..]).await }); - } - Ok(()) } |