From 39d42d846ae387c1ba8f5ab2432b48bd412360b6 Mon Sep 17 00:00:00 2001 From: John Spray Date: Mon, 17 Feb 2025 15:04:47 +0000 Subject: [PATCH] pageserver_api: fix decoding old-version TimelineInfo (#10845) ## Problem In #10707 some new fields were introduced in TimelineInfo. I forgot that we do not only use TimelineInfo for encoding, but also decoding when the storage controller calls into a pageserver, so this broke some calls from controller to pageserver while in a mixed-version state. ## Summary of changes - Make new fields have default behavior so that they are optional --- libs/pageserver_api/src/models.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/pageserver_api/src/models.rs b/libs/pageserver_api/src/models.rs index 426222a531..3d40cfe121 100644 --- a/libs/pageserver_api/src/models.rs +++ b/libs/pageserver_api/src/models.rs @@ -1144,6 +1144,7 @@ pub struct TimelineInfo { /// The LSN up to which GC has advanced: older data may still exist but it is not available for clients. /// This LSN is not suitable for deciding where to create branches etc: use [`TimelineInfo::min_readable_lsn`] instead, /// as it is easier to reason about. + #[serde(default)] pub applied_gc_cutoff_lsn: Lsn, /// The upper bound of data which is either already GC'ed, or elegible to be GC'ed at any time based on PITR interval. @@ -1152,6 +1153,7 @@ pub struct TimelineInfo { /// /// Note that holders of valid LSN leases may be able to create branches and read pages earlier /// than this LSN, but new leases may not be taken out earlier than this LSN. + #[serde(default)] pub min_readable_lsn: Lsn, pub disk_consistent_lsn: Lsn,