diff --git a/pageserver/src/tenant/storage_layer/image_layer.rs b/pageserver/src/tenant/storage_layer/image_layer.rs index 072ecce30f..ed490fed21 100644 --- a/pageserver/src/tenant/storage_layer/image_layer.rs +++ b/pageserver/src/tenant/storage_layer/image_layer.rs @@ -396,7 +396,12 @@ impl ImageLayerInner { let actual_summary = Summary::des_prefix(summary_blk.as_ref()).context("deserialize first block")?; + if actual_summary.format_version > STORAGE_FORMAT_VERSION { + bail!("Forward compatibility of storage is not supported: current format version is {}, format version of layer {} is {}", STORAGE_FORMAT_VERSION, path, actual_summary.format_version); + } if let Some(mut expected_summary) = summary { + // assume backward compatibility + expected_summary.format_version = actual_summary.format_version; // production code path expected_summary.index_start_blk = actual_summary.index_start_blk; expected_summary.index_root_blk = actual_summary.index_root_blk;