aboutsummaryrefslogtreecommitdiff
path: root/src/table/replication
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-12-07 11:16:10 +0100
committerAlex Auvolat <alex@adnab.me>2023-12-07 11:16:10 +0100
commitd90de365b3b30cb631b22fcd62c98bddb5a91549 (patch)
tree9ee7226fa49571179b9fd7ff03e45a838a51a909 /src/table/replication
parent95eb13eb08d517d328e3c8aeb222440a27211ee9 (diff)
downloadgarage-d90de365b3b30cb631b22fcd62c98bddb5a91549.tar.gz
garage-d90de365b3b30cb631b22fcd62c98bddb5a91549.zip
table sync: use write quorums to report global success or failure of sync
Diffstat (limited to 'src/table/replication')
-rw-r--r--src/table/replication/fullcopy.rs3
-rw-r--r--src/table/replication/parameters.rs2
-rw-r--r--src/table/replication/sharded.rs4
3 files changed, 4 insertions, 5 deletions
diff --git a/src/table/replication/fullcopy.rs b/src/table/replication/fullcopy.rs
index df930224..30122f39 100644
--- a/src/table/replication/fullcopy.rs
+++ b/src/table/replication/fullcopy.rs
@@ -1,4 +1,3 @@
-use std::iter::FromIterator;
use std::sync::Arc;
use garage_rpc::layout::*;
@@ -69,7 +68,7 @@ impl TableReplication for TableFullReplication {
partition: 0u16,
first_hash: [0u8; 32].into(),
last_hash: [0xff; 32].into(),
- storage_nodes: Vec::from_iter(layout.current().all_nodes().to_vec()),
+ storage_sets: vec![layout.current().all_nodes().to_vec()],
}],
}
}
diff --git a/src/table/replication/parameters.rs b/src/table/replication/parameters.rs
index db11ff5f..78470f35 100644
--- a/src/table/replication/parameters.rs
+++ b/src/table/replication/parameters.rs
@@ -40,5 +40,5 @@ pub struct SyncPartition {
pub partition: Partition,
pub first_hash: Hash,
pub last_hash: Hash,
- pub storage_nodes: Vec<Uuid>,
+ pub storage_sets: Vec<Vec<Uuid>>,
}
diff --git a/src/table/replication/sharded.rs b/src/table/replication/sharded.rs
index 2a16bc0c..55d0029d 100644
--- a/src/table/replication/sharded.rs
+++ b/src/table/replication/sharded.rs
@@ -60,12 +60,12 @@ impl TableReplication for TableShardedReplication {
.current()
.partitions()
.map(|(partition, first_hash)| {
- let storage_nodes = layout.storage_nodes_of(&first_hash);
+ let storage_sets = layout.storage_sets_of(&first_hash);
SyncPartition {
partition,
first_hash,
last_hash: [0u8; 32].into(), // filled in just after
- storage_nodes,
+ storage_sets,
}
})
.collect::<Vec<_>>();