From ae263e5adf388f1f3aa12a98ce0a03ec2f332c80 Mon Sep 17 00:00:00 2001 From: BodoBolero Date: Thu, 12 Sep 2024 15:15:14 +0100 Subject: [PATCH] branching in tenant rs depending if new version is higher --- pageserver/src/tenant.rs | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/pageserver/src/tenant.rs b/pageserver/src/tenant.rs index fb30857ddf..65ccafac27 100644 --- a/pageserver/src/tenant.rs +++ b/pageserver/src/tenant.rs @@ -1709,15 +1709,32 @@ impl Tenant { WaitLsnError::Shutdown => CreateTimelineError::ShuttingDown, })?; } + // hackathon hackaneon single click postgres upgrade + if pg_version > ancestor_timeline.pg_version { + let old_pg_version = ancestor_timeline.pg_version; + tracing::info!("Upgrading timeline {new_timeline_id} from version {old_pg_version} to {pg_version}"); + // add new stuff here + self.branch_timeline( + &ancestor_timeline, + new_timeline_id, + ancestor_start_lsn, + create_guard, + ctx, + ) + .await? + } else { + self.branch_timeline( + &ancestor_timeline, + new_timeline_id, + ancestor_start_lsn, + create_guard, + ctx, + ) + .await? - self.branch_timeline( - &ancestor_timeline, - new_timeline_id, - ancestor_start_lsn, - create_guard, - ctx, - ) - .await? + } + + } None => { self.bootstrap_timeline(