From 4317ef003f23b7e6f04d7f2f0e23729047e23cd5 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 12 Jul 2021 12:40:50 +0800 Subject: [PATCH] common/LogEntry: drop support of LogSummary v2 encoding scheme LogSummary's v3 encoding scheme was introduced in 648aaf271cb02c647f046288656c11f15a7799b2, which was in turn included by Ceph v13.1.0 and all newer releases. since LogSummary is persistented by monitor, and it is trimmed regularly by monitor, there is no need to read a LogSummary encoded by 2 releases older monitor. in this change, the support of LogSummary v2 encoding scheme is dropped. Signed-off-by: Kefu Chai --- src/common/LogEntry.cc | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/src/common/LogEntry.cc b/src/common/LogEntry.cc index 9ca0ddfb1c227..d7b44a2110bd4 100644 --- a/src/common/LogEntry.cc +++ b/src/common/LogEntry.cc @@ -309,15 +309,7 @@ void LogSummary::build_ordered_tail_legacy(list *tail) const void LogSummary::encode(bufferlist& bl, uint64_t features) const { - if (!HAVE_FEATURE(features, SERVER_MIMIC)) { - ENCODE_START(2, 2, bl); - encode(version, bl); - list tail; - build_ordered_tail_legacy(&tail); - encode(tail, bl, features); - ENCODE_FINISH(bl); - return; - } + assert(HAVE_FEATURE(features, SERVER_MIMIC)); ENCODE_START(4, 3, bl); encode(version, bl); encode(seq, bl); @@ -331,19 +323,11 @@ void LogSummary::decode(bufferlist::const_iterator& bl) { DECODE_START_LEGACY_COMPAT_LEN(4, 2, 2, bl); decode(version, bl); - if (struct_v < 3) { - list tail; - decode(tail, bl); - for (auto& i : tail) { - add_legacy(i); - } - } else { - decode(seq, bl); - decode(tail_by_channel, bl); - if (struct_v >= 4) { - decode(channel_info, bl); - recent_keys.decode(bl); - } + decode(seq, bl); + decode(tail_by_channel, bl); + if (struct_v >= 4) { + decode(channel_info, bl); + recent_keys.decode(bl); } DECODE_FINISH(bl); keys.clear(); -- 2.39.5