From: Sage Weil Date: Sat, 10 Oct 2009 04:55:44 +0000 (-0700) Subject: mon: kill unused MOSDGetMap X-Git-Tag: v0.17~86 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d1c51b264275710c06b8b438ccc9cea1c91402b3;p=ceph.git mon: kill unused MOSDGetMap Yay --- diff --git a/src/Makefile.am b/src/Makefile.am index 837058fd05fb..d2bd25016a9c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -576,7 +576,6 @@ noinst_HEADERS = \ messages/MOSDAlive.h\ messages/MOSDBoot.h\ messages/MOSDFailure.h\ - messages/MOSDGetMap.h\ messages/MOSDIn.h\ messages/MOSDMap.h\ messages/MOSDOp.h\ diff --git a/src/TODO b/src/TODO index 6226afa52305..9b000318971c 100644 --- a/src/TODO +++ b/src/TODO @@ -45,6 +45,7 @@ v0.17 - kill mon->osd - kill shutdown msg + - route send_full/send_latest... - kill mon->mds - beacon reply - kill shutdown msg diff --git a/src/include/ceph_fs.h b/src/include/ceph_fs.h index 64ef06fadb45..56af192cb430 100644 --- a/src/include/ceph_fs.h +++ b/src/include/ceph_fs.h @@ -114,7 +114,6 @@ int ceph_file_layout_is_valid(const struct ceph_file_layout *layout); #define CEPH_MSG_CLIENT_CAPRELEASE 0x313 /* osd */ -#define CEPH_MSG_OSD_GETMAP 40 #define CEPH_MSG_OSD_MAP 41 #define CEPH_MSG_OSD_OP 42 #define CEPH_MSG_OSD_OPREPLY 43 diff --git a/src/messages/MOSDGetMap.h b/src/messages/MOSDGetMap.h deleted file mode 100644 index eb29e6cecfdb..000000000000 --- a/src/messages/MOSDGetMap.h +++ /dev/null @@ -1,52 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab -/* - * Ceph - scalable distributed file system - * - * Copyright (C) 2004-2006 Sage Weil - * - * This is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software - * Foundation. See file COPYING. - * - */ - -#ifndef __MOSDGETMAP_H -#define __MOSDGETMAP_H - -#include "messages/PaxosServiceMessage.h" - -#include "include/types.h" - -class MOSDGetMap : public PaxosServiceMessage { - public: - ceph_fsid_t fsid; - epoch_t start; // this is the first incremental the sender wants (he has start-1) - - MOSDGetMap() : PaxosServiceMessage(CEPH_MSG_OSD_GETMAP, 0) {} - MOSDGetMap(const ceph_fsid_t& f, epoch_t s=0) : - PaxosServiceMessage(CEPH_MSG_OSD_GETMAP, s>0 ? s-1 : 0), - fsid(f), start(s) { } - - epoch_t get_start_epoch() { return start; } - - const char *get_type_name() { return "get_osd_map"; } - void print(ostream& out) { - out << "get_osd_map(start " << start << ")"; - } - - void encode_payload() { - paxos_encode(); - ::encode(fsid, payload); - ::encode(start, payload); - } - void decode_payload() { - bufferlist::iterator p = payload.begin(); - paxos_decode(p); - ::decode(fsid, p); - ::decode(start, p); - } -}; - -#endif diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index ca18c9344c8b..497be13d0e38 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -321,6 +321,11 @@ void Monitor::reply_command(MMonCommand *m, int rc, const string &rs, bufferlist // ------------------------ // request/reply routing +// +// a client/mds/osd will connect to a random monitor. we need to forward any +// messages requiring state updates to the leader, and then route any replies +// back via the correct monitor and back to them. (the monitor will not +// initiate any connections.) void Monitor::forward_request_leader(PaxosServiceMessage *req) { @@ -508,7 +513,6 @@ bool Monitor::ms_dispatch(Message *m) break; // OSDs - case CEPH_MSG_OSD_GETMAP: case MSG_OSD_FAILURE: case MSG_OSD_BOOT: case MSG_OSD_IN: diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index d447bb32caf7..cdf655dbae2f 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -23,7 +23,6 @@ #include "messages/MOSDFailure.h" #include "messages/MOSDMap.h" -#include "messages/MOSDGetMap.h" #include "messages/MOSDBoot.h" #include "messages/MOSDAlive.h" #include "messages/MPoolOp.h" @@ -196,10 +195,6 @@ bool OSDMonitor::preprocess_query(PaxosServiceMessage *m) switch (m->get_type()) { // READs - case CEPH_MSG_OSD_GETMAP: - handle_osd_getmap((MOSDGetMap*)m); - return true; - case MSG_MON_COMMAND: return preprocess_command((MMonCommand*)m); @@ -291,28 +286,6 @@ bool OSDMonitor::should_propose(double& delay) // --------------------------- // READs -void OSDMonitor::handle_osd_getmap(MOSDGetMap *m) -{ - dout(7) << "handle_osd_getmap from " << m->get_orig_source() - << " start " << m->get_start_epoch() - << dendl; - - if (ceph_fsid_compare(&m->fsid, &mon->monmap->fsid)) { - dout(0) << "handle_osd_getmap on fsid " << m->fsid << " != " << mon->monmap->fsid << dendl; - goto out; - } - - if (m->get_start_epoch()) { - if (m->get_start_epoch() <= osdmap.get_epoch()) - send_incremental(m->get_orig_source_inst(), m->get_start_epoch()); - else - waiting_for_map[m->get_orig_source_inst()] = m->get_start_epoch(); - } else - send_full(m->get_orig_source_inst()); - - out: - delete m; -} // --------------------------- // UPDATEs diff --git a/src/mon/OSDMonitor.h b/src/mon/OSDMonitor.h index 1642c84d1b51..de14223884ad 100644 --- a/src/mon/OSDMonitor.h +++ b/src/mon/OSDMonitor.h @@ -68,8 +68,6 @@ private: void send_full(entity_inst_t dest); void send_incremental(entity_inst_t dest, epoch_t since); - void handle_osd_getmap(class MOSDGetMap *m); - bool preprocess_failure(class MOSDFailure *m); bool prepare_failure(class MOSDFailure *m); void _reported_failure(MOSDFailure *m); diff --git a/src/msg/Message.cc b/src/msg/Message.cc index ebebe2b9d264..bc17a888c874 100644 --- a/src/msg/Message.cc +++ b/src/msg/Message.cc @@ -50,7 +50,6 @@ using namespace std; #include "messages/MOSDSubOp.h" #include "messages/MOSDSubOpReply.h" #include "messages/MOSDMap.h" -#include "messages/MOSDGetMap.h" #include "messages/MOSDPGNotify.h" #include "messages/MOSDPGQuery.h" @@ -290,9 +289,6 @@ Message *decode_message(ceph_msg_header& header, ceph_msg_footer& footer, case CEPH_MSG_OSD_MAP: m = new MOSDMap; break; - case CEPH_MSG_OSD_GETMAP: - m = new MOSDGetMap; - break; case MSG_OSD_PG_NOTIFY: m = new MOSDPGNotify;