aboutsummaryrefslogtreecommitdiff
path: root/src/table.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-23 13:37:10 +0000
committerAlex Auvolat <alex@adnab.me>2020-04-23 13:37:10 +0000
commit37f880bc09bc4d9eb6aaeaec299a8d1d2043f674 (patch)
treed0f8aeeb826edbaaa8e38f9eb907b3a84579e4c5 /src/table.rs
parent73574ab43e5dca999545c931b959f2a3cbacea95 (diff)
downloadgarage-37f880bc09bc4d9eb6aaeaec299a8d1d2043f674.tar.gz
garage-37f880bc09bc4d9eb6aaeaec299a8d1d2043f674.zip
RequestStrategy with possible interruption or not
Diffstat (limited to 'src/table.rs')
-rw-r--r--src/table.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/table.rs b/src/table.rs
index bc375a96..53e17396 100644
--- a/src/table.rs
+++ b/src/table.rs
@@ -179,8 +179,8 @@ where
.try_call_many(
&who[..],
rpc,
- self.replication.write_quorum(),
- TABLE_RPC_TIMEOUT,
+ RequestStrategy::with_quorum(self.replication.write_quorum())
+ .with_timeout(TABLE_RPC_TIMEOUT),
)
.await?;
Ok(())
@@ -237,8 +237,9 @@ where
.try_call_many(
&who[..],
rpc,
- self.replication.read_quorum(),
- TABLE_RPC_TIMEOUT,
+ RequestStrategy::with_quorum(self.replication.read_quorum())
+ .with_timeout(TABLE_RPC_TIMEOUT)
+ .interrupt_after_quorum(true),
)
.await?;
@@ -292,8 +293,9 @@ where
.try_call_many(
&who[..],
rpc,
- self.replication.read_quorum(),
- TABLE_RPC_TIMEOUT,
+ RequestStrategy::with_quorum(self.replication.read_quorum())
+ .with_timeout(TABLE_RPC_TIMEOUT)
+ .interrupt_after_quorum(true),
)
.await?;
@@ -347,8 +349,7 @@ where
.try_call_many(
&who[..],
TableRPC::<F>::Update(vec![what_enc]),
- who.len(),
- TABLE_RPC_TIMEOUT,
+ RequestStrategy::with_quorum(who.len()).with_timeout(TABLE_RPC_TIMEOUT),
)
.await?;
Ok(())