aboutsummaryrefslogtreecommitdiff
path: root/src/table/table.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-03-16 11:14:27 +0100
committerAlex Auvolat <alex@adnab.me>2021-03-16 11:14:27 +0100
commit1d9961e4118af0e26068e1d6c5c6c009a1292a88 (patch)
treee05bc162772e8c4a5bd658f437de02108b55c5a2 /src/table/table.rs
parent6a8439fd1345ecae7414386f76dda7a03eb14df2 (diff)
downloadgarage-1d9961e4118af0e26068e1d6c5c6c009a1292a88.tar.gz
garage-1d9961e4118af0e26068e1d6c5c6c009a1292a88.zip
Simplify replication logic
Diffstat (limited to 'src/table/table.rs')
-rw-r--r--src/table/table.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/table/table.rs b/src/table/table.rs
index 2d3c5fe9..2ce5868f 100644
--- a/src/table/table.rs
+++ b/src/table/table.rs
@@ -91,7 +91,7 @@ where
pub async fn insert(&self, e: &F::E) -> Result<(), Error> {
let hash = e.partition_key().hash();
- let who = self.aux.replication.write_nodes(&hash, &self.aux.system);
+ let who = self.aux.replication.write_nodes(&hash);
//eprintln!("insert who: {:?}", who);
let e_enc = Arc::new(ByteBuf::from(rmp_to_vec_all_named(e)?));
@@ -101,7 +101,7 @@ where
.try_call_many(
&who[..],
rpc,
- RequestStrategy::with_quorum(self.aux.replication.write_quorum(&self.aux.system))
+ RequestStrategy::with_quorum(self.aux.replication.write_quorum())
.with_timeout(TABLE_RPC_TIMEOUT),
)
.await?;
@@ -113,7 +113,7 @@ where
for entry in entries.iter() {
let hash = entry.partition_key().hash();
- let who = self.aux.replication.write_nodes(&hash, &self.aux.system);
+ let who = self.aux.replication.write_nodes(&hash);
let e_enc = Arc::new(ByteBuf::from(rmp_to_vec_all_named(entry)?));
for node in who {
if !call_list.contains_key(&node) {
@@ -150,7 +150,7 @@ where
sort_key: &F::S,
) -> Result<Option<F::E>, Error> {
let hash = partition_key.hash();
- let who = self.aux.replication.read_nodes(&hash, &self.aux.system);
+ let who = self.aux.replication.read_nodes(&hash);
//eprintln!("get who: {:?}", who);
let rpc = TableRPC::<F>::ReadEntry(partition_key.clone(), sort_key.clone());
@@ -207,7 +207,7 @@ where
limit: usize,
) -> Result<Vec<F::E>, Error> {
let hash = partition_key.hash();
- let who = self.aux.replication.read_nodes(&hash, &self.aux.system);
+ let who = self.aux.replication.read_nodes(&hash);
let rpc = TableRPC::<F>::ReadRange(partition_key.clone(), begin_sort_key, filter, limit);