table: take into account multiple write sets in inserts

This commit is contained in:
Alex Auvolat
2023-11-14 15:40:46 +01:00
parent 3b361d2959
commit 90e1619b1e
6 changed files with 190 additions and 135 deletions
+2 -2
View File
@@ -230,7 +230,7 @@ impl<F: TableSchema, R: TableReplication> TableGc<F, R> {
.rpc_helper()
.try_call_many(
&self.endpoint,
&nodes[..],
&nodes,
GcRpc::Update(updates),
RequestStrategy::with_priority(PRIO_BACKGROUND).with_quorum(nodes.len()),
)
@@ -251,7 +251,7 @@ impl<F: TableSchema, R: TableReplication> TableGc<F, R> {
.rpc_helper()
.try_call_many(
&self.endpoint,
&nodes[..],
&nodes,
GcRpc::DeleteIfEqualHash(deletes),
RequestStrategy::with_priority(PRIO_BACKGROUND).with_quorum(nodes.len()),
)
+7 -10
View File
@@ -119,17 +119,16 @@ impl<F: TableSchema, R: TableReplication> Table<F, R> {
async fn insert_internal(&self, e: &F::E) -> Result<(), Error> {
let hash = e.partition_key().hash();
// TODO: use write sets
let who = self.data.replication.storage_nodes(&hash);
let who = self.data.replication.write_sets(&hash);
let e_enc = Arc::new(ByteBuf::from(e.encode()?));
let rpc = TableRpc::<F>::Update(vec![e_enc]);
self.system
.rpc_helper()
.try_call_many(
.try_write_many_sets(
&self.endpoint,
&who[..],
&who,
rpc,
RequestStrategy::with_priority(PRIO_NORMAL)
.with_quorum(self.data.replication.write_quorum()),
@@ -243,11 +242,10 @@ impl<F: TableSchema, R: TableReplication> Table<F, R> {
.rpc_helper()
.try_call_many(
&self.endpoint,
&who[..],
&who,
rpc,
RequestStrategy::with_priority(PRIO_NORMAL)
.with_quorum(self.data.replication.read_quorum())
.interrupt_after_quorum(true),
.with_quorum(self.data.replication.read_quorum()),
)
.await?;
@@ -339,11 +337,10 @@ impl<F: TableSchema, R: TableReplication> Table<F, R> {
.rpc_helper()
.try_call_many(
&self.endpoint,
&who[..],
&who,
rpc,
RequestStrategy::with_priority(PRIO_NORMAL)
.with_quorum(self.data.replication.read_quorum())
.interrupt_after_quorum(true),
.with_quorum(self.data.replication.read_quorum()),
)
.await?;