]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/LogEntry: drop support of LogSummary v2 encoding scheme 42276/head
authorKefu Chai <kchai@redhat.com>
Mon, 12 Jul 2021 04:40:50 +0000 (12:40 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 13 Jul 2021 17:09:28 +0000 (01:09 +0800)
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 <kchai@redhat.com>
src/common/LogEntry.cc

index 9ca0ddfb1c22784da2c43e7b04157a3a58109cd6..d7b44a2110bd4fc4beb2c7ae543c3d3f1e9b3c56 100644 (file)
@@ -309,15 +309,7 @@ void LogSummary::build_ordered_tail_legacy(list<LogEntry> *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<LogEntry> 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<LogEntry> 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();