From 4d54ba9b0b43207aa19da3345cf6637c980330d7 Mon Sep 17 00:00:00 2001 From: Yixin Luo <18810541851@163.com> Date: Tue, 16 May 2023 14:11:39 +0800 Subject: [PATCH] [BugFix] fix snapshot meta upgrade compatible (#23442) Fixes #20436 When the BE try to parse the snapshot generated by old version BE, the snapshot doesn't contain delta column in footer, so parse will fail. Signed-off-by: luohaha <18810541851@163.com> --- be/src/storage/snapshot_meta.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/be/src/storage/snapshot_meta.cpp b/be/src/storage/snapshot_meta.cpp index 30aa2b8c67acf3..43f5b276a07b6c 100644 --- a/be/src/storage/snapshot_meta.cpp +++ b/be/src/storage/snapshot_meta.cpp @@ -150,6 +150,10 @@ Status SnapshotMeta::_parse_delta_column_group(SnapshotMetaFooterPB& footer, Ran return Status::InternalError( fmt::format("mismatched delta column group size and segment id size, file: {}", file->filename())); } + if (footer.dcg_offsets_size() == 0) { + // this snapshot meta is generated by low version BE. + return Status::OK(); + } // Parse delta column group std::string buff; const int num_dcglists = footer.dcg_offsets_size() - 1;