]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/Monitor: do not handle MMonMetadata
authorKefu Chai <kchai@redhat.com>
Fri, 28 Aug 2020 08:17:53 +0000 (16:17 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 28 Aug 2020 08:32:08 +0000 (16:32 +0800)
MMonMetadata is sent to pre-luminous monitors and handled only for
backward compatibility with pre-luminous monitors. and luminous is the
last release we were still sending this message. but there is no need
for pacific to be compatible with pre-luminous monitors because of the
+2 policy.

so let's stop handle this message in pacific and up.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/Monitor.cc
src/mon/Monitor.h

index 671b07aeb9ac53d4683d24c1178107d8e9034847..51d5c12c41e58a4c2f0d5e5eb159e27cf1f6547c 100644 (file)
@@ -44,7 +44,6 @@
 #include "messages/MGenericMessage.h"
 #include "messages/MMonCommand.h"
 #include "messages/MMonCommandAck.h"
-#include "messages/MMonMetadata.h"
 #include "messages/MMonSync.h"
 #include "messages/MMonScrub.h"
 #include "messages/MMonProbe.h"
@@ -4430,9 +4429,6 @@ void Monitor::dispatch_op(MonOpRequestRef op)
       configmon()->handle_get_config(op);
       return;
 
-    case CEPH_MSG_MON_METADATA:
-      return handle_mon_metadata(op);
-
     case CEPH_MSG_MON_SUBSCRIBE:
       /* FIXME: check what's being subscribed, filter accordingly */
       handle_subscribe(op);
@@ -5263,27 +5259,6 @@ void Monitor::handle_mon_get_map(MonOpRequestRef op)
   send_latest_monmap(m->get_connection().get());
 }
 
-void Monitor::handle_mon_metadata(MonOpRequestRef op)
-{
-  auto m = op->get_req<MMonMetadata>();
-  if (is_leader()) {
-    dout(10) << __func__ << dendl;
-    update_mon_metadata(m->get_source().num(), std::move(m->data));
-  }
-}
-
-void Monitor::update_mon_metadata(int from, Metadata&& m)
-{
-  // NOTE: this is now for legacy (kraken or jewel) mons only.
-  pending_metadata[from] = std::move(m);
-
-  MonitorDBStore::TransactionRef t = paxos->get_pending_transaction();
-  bufferlist bl;
-  encode(pending_metadata, bl);
-  t->put(MONITOR_STORE_PREFIX, "last_metadata", bl);
-  paxos->trigger_propose();
-}
-
 int Monitor::load_metadata()
 {
   bufferlist bl;
index 096cc680e81b8694e31bcb05f72817ebeff15ce1..d8db8bf01043b24b5a8d08a4ab94c304bfda9834 100644 (file)
@@ -692,11 +692,10 @@ public:
   void handle_command(MonOpRequestRef op);
   void handle_route(MonOpRequestRef op);
 
-  void handle_mon_metadata(MonOpRequestRef op);
   int get_mon_metadata(int mon, ceph::Formatter *f, std::ostream& err);
   int print_nodes(ceph::Formatter *f, std::ostream& err);
 
-  // Accumulate metadata across calls to update_mon_metadata
+  // track metadata reported by win_election()
   std::map<int, Metadata> mon_metadata;
   std::map<int, Metadata> pending_metadata;
 
@@ -932,7 +931,6 @@ private:
   void extract_save_mon_key(KeyRing& keyring);
 
   void collect_metadata(Metadata *m);
-  void update_mon_metadata(int from, Metadata&& m);
   int load_metadata();
   void count_metadata(const std::string& field, ceph::Formatter *f);
   void count_metadata(const std::string& field, std::map<std::string,int> *out);