diff options
author | Alex Auvolat <alex@adnab.me> | 2023-11-11 12:08:32 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-11-11 12:08:32 +0100 |
commit | ce89d1ddabe3b9e638b0173949726522ae9a0311 (patch) | |
tree | 81be9981c5a6ed155d5500165dbaee5dfa8db7e9 /src/table/replication/parameters.rs | |
parent | df36cf3099f6010c4fc62109b85d4d1e62f160cc (diff) | |
download | garage-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.rs | 19 |
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>, } |