aboutsummaryrefslogtreecommitdiff
path: root/src/table/replication/parameters.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-11-11 12:08:32 +0100
committerAlex Auvolat <alex@adnab.me>2023-11-11 12:08:32 +0100
commitce89d1ddabe3b9e638b0173949726522ae9a0311 (patch)
tree81be9981c5a6ed155d5500165dbaee5dfa8db7e9 /src/table/replication/parameters.rs
parentdf36cf3099f6010c4fc62109b85d4d1e62f160cc (diff)
downloadgarage-ce89d1ddabe3b9e638b0173949726522ae9a0311.tar.gz
garage-ce89d1ddabe3b9e638b0173949726522ae9a0311.zip
table sync: adapt to new layout history
Diffstat (limited to 'src/table/replication/parameters.rs')
-rw-r--r--src/table/replication/parameters.rs19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/table/replication/parameters.rs b/src/table/replication/parameters.rs
index 19b306f2..2a7d3585 100644
--- a/src/table/replication/parameters.rs
+++ b/src/table/replication/parameters.rs
@@ -20,6 +20,21 @@ pub trait TableReplication: Send + Sync + 'static {
// Accessing partitions, for Merkle tree & sync
/// Get partition for data with given hash
fn partition_of(&self, hash: &Hash) -> Partition;
- /// List of existing partitions
- fn partitions(&self) -> Vec<(Partition, Hash)>;
+
+ /// List of partitions and nodes to sync with in current layout
+ fn sync_partitions(&self) -> SyncPartitions;
+}
+
+#[derive(Debug)]
+pub struct SyncPartitions {
+ pub layout_version: u64,
+ pub partitions: Vec<SyncPartition>,
+}
+
+#[derive(Debug)]
+pub struct SyncPartition {
+ pub partition: Partition,
+ pub first_hash: Hash,
+ pub last_hash: Hash,
+ pub storage_nodes: Vec<Uuid>,
}