aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/layout/schema.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-11-27 11:52:57 +0100
committerAlex Auvolat <alex@adnab.me>2023-11-27 11:52:57 +0100
commitd6d239fc7909cbd017da6ea35cceb3d561a87cca (patch)
tree18725effafdd990d7e2953adcc1b50399673caed /src/rpc/layout/schema.rs
parent3ecd14b9f6202ad3c5513c6ad7422bd408134002 (diff)
downloadgarage-d6d239fc7909cbd017da6ea35cceb3d561a87cca.tar.gz
garage-d6d239fc7909cbd017da6ea35cceb3d561a87cca.zip
block manager: read_block using old layout versions if necessary
Diffstat (limited to 'src/rpc/layout/schema.rs')
-rw-r--r--src/rpc/layout/schema.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rpc/layout/schema.rs b/src/rpc/layout/schema.rs
index 00a2c017..08db44ca 100644
--- a/src/rpc/layout/schema.rs
+++ b/src/rpc/layout/schema.rs
@@ -193,12 +193,18 @@ mod v010 {
use std::collections::BTreeMap;
pub use v09::{LayoutParameters, NodeRole, NodeRoleV, ZoneRedundancy};
+ pub const OLD_VERSION_COUNT: usize = 5;
+
/// The history of cluster layouts, with trackers to keep a record
/// of which nodes are up-to-date to current cluster data
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct LayoutHistory {
/// The versions currently in use in the cluster
pub versions: Vec<LayoutVersion>,
+ /// At most 5 of the previous versions, not used by the garage_table
+ /// module, but usefull for the garage_block module to find data blocks
+ /// that have not yet been moved
+ pub old_versions: Vec<LayoutVersion>,
/// Update trackers
pub update_trackers: UpdateTrackers,
@@ -300,6 +306,7 @@ mod v010 {
};
Self {
versions: vec![version],
+ old_versions: vec![],
update_trackers: UpdateTrackers {
ack_map: update_tracker.clone(),
sync_map: update_tracker.clone(),