From: Kefu Chai Date: Mon, 12 Jul 2021 04:40:50 +0000 (+0800) Subject: common/LogEntry: drop support of LogSummary v2 encoding scheme X-Git-Tag: v17.1.0~1416^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4317ef003f23b7e6f04d7f2f0e23729047e23cd5;p=ceph.git 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 --- diff --git a/src/common/LogEntry.cc b/src/common/LogEntry.cc index 9ca0ddfb1c22..d7b44a2110bd 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();