aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/membership.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-05-28 13:58:47 +0200
committerAlex Auvolat <alex@adnab.me>2021-05-28 15:29:58 +0200
commitb9127dd6f88d3c66181ef6748167efd94283ff41 (patch)
treea05030f4e16678b3dc997c6d2ec057ff9e7a19fb /src/rpc/membership.rs
parentddb2b29bfd1da75a9035fecf15169891be5bcafd (diff)
downloadgarage-b9127dd6f88d3c66181ef6748167efd94283ff41.tar.gz
garage-b9127dd6f88d3c66181ef6748167efd94283ff41.zip
Prepare for v0.3.0 and add migration path from v0.2.1.xv0.3.0
Diffstat (limited to 'src/rpc/membership.rs')
-rw-r--r--src/rpc/membership.rs20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/rpc/membership.rs b/src/rpc/membership.rs
index 37cf8105..72477539 100644
--- a/src/rpc/membership.rs
+++ b/src/rpc/membership.rs
@@ -240,11 +240,21 @@ impl System {
let net_config = match persist_config.load() {
Ok(x) => x,
Err(e) => {
- info!(
- "No valid previous network configuration stored ({}), starting fresh.",
- e
- );
- NetworkConfig::new()
+ match Persister::<garage_rpc_021::ring::NetworkConfig>::new(
+ &metadata_dir,
+ "network_config",
+ )
+ .load()
+ {
+ Ok(old_config) => NetworkConfig::migrate_from_021(old_config),
+ Err(e2) => {
+ info!(
+ "No valid previous network configuration stored ({}, {}), starting fresh.",
+ e, e2
+ );
+ NetworkConfig::new()
+ }
+ }
}
};