summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Farnum <gregf@hq.newdream.net>2009-06-25 23:51:11 +0200
committerGreg Farnum <gregf@hq.newdream.net>2009-06-25 23:54:06 +0200
commit77db2e0b9e7431fef874dfd4792cf35b854e9489 (patch)
tree0a66fdf1f25af874c177b3985d8162c7a0891b9e
parentmessages/MClass[Ack]: Roll back some unification. (diff)
downloadceph-77db2e0b9e7431fef874dfd4792cf35b854e9489.tar.xz
ceph-77db2e0b9e7431fef874dfd4792cf35b854e9489.zip
messages: Clean up of PaxosServiceMessages, and some fixes for their users.
-rw-r--r--src/common/LogClient.cc2
-rw-r--r--src/common/LogClient.h1
-rw-r--r--src/mds/SnapServer.cc2
-rw-r--r--src/messages/MClass.h4
-rw-r--r--src/messages/MClientMount.h2
-rw-r--r--src/messages/MClientUnmount.h2
-rw-r--r--src/messages/MGetPoolStats.h2
-rw-r--r--src/messages/MGetPoolStatsReply.h2
-rw-r--r--src/messages/MLog.h6
-rw-r--r--src/messages/MMDSBeacon.h12
-rw-r--r--src/messages/MMDSGetMap.h2
-rw-r--r--src/messages/MMonCommand.h4
-rw-r--r--src/messages/MMonCommandAck.h4
-rw-r--r--src/messages/MMonPaxos.h10
-rw-r--r--src/messages/MOSDAlive.h2
-rw-r--r--src/messages/MOSDBoot.h2
-rw-r--r--src/messages/MOSDFailure.h2
-rw-r--r--src/messages/MOSDGetMap.h4
-rw-r--r--src/messages/MPGStats.h2
-rw-r--r--src/messages/MPoolSnap.h4
-rw-r--r--src/messages/MPoolSnapReply.h4
-rw-r--r--src/messages/MRemoveSnaps.h8
-rw-r--r--src/messages/MStatfs.h2
-rw-r--r--src/mon/MDSMonitor.cc4
-rw-r--r--src/mon/Monitor.cc8
-rw-r--r--src/mon/Monitor.h6
-rw-r--r--src/mon/OSDMonitor.cc4
27 files changed, 52 insertions, 55 deletions
diff --git a/src/common/LogClient.cc b/src/common/LogClient.cc
index 4ed48723dcd..039feb1c60d 100644
--- a/src/common/LogClient.cc
+++ b/src/common/LogClient.cc
@@ -77,7 +77,7 @@ void LogClient::_send_log()
{
if (log_queue.empty())
return;
- MLog *log = new MLog(monmap->get_fsid(), log_queue, VERSION_T);
+ MLog *log = new MLog(monmap->get_fsid(), log_queue);
int mon;
if (messenger->get_myname().is_mon())
diff --git a/src/common/LogClient.h b/src/common/LogClient.h
index 87e39d6f0a0..caa93114917 100644
--- a/src/common/LogClient.h
+++ b/src/common/LogClient.h
@@ -35,6 +35,7 @@ class LogClient : public Dispatcher {
bool dispatch_impl(Message *m);
bool is_synchronous;
void _send_log();
+
public:
// -- log --
diff --git a/src/mds/SnapServer.cc b/src/mds/SnapServer.cc
index da42c911a4a..e4d06cc9d50 100644
--- a/src/mds/SnapServer.cc
+++ b/src/mds/SnapServer.cc
@@ -248,7 +248,7 @@ void SnapServer::check_osd_map(bool force)
if (!all_purge.empty()) {
dout(10) << "requesting removal of " << all_purge << dendl;
- MRemoveSnaps *m = new MRemoveSnaps(all_purge, VERSION_T);
+ MRemoveSnaps *m = new MRemoveSnaps(all_purge);
int mon = mds->monmap->pick_mon();
mds->messenger->send_message(m, mds->monmap->get_inst(mon));
}
diff --git a/src/messages/MClass.h b/src/messages/MClass.h
index b969292af17..0c105fe7555 100644
--- a/src/messages/MClass.h
+++ b/src/messages/MClass.h
@@ -35,7 +35,7 @@ public:
__s32 action;
- MClass() : PaxosServiceMessage(MSG_CLASS, 0), {}
+ MClass() : PaxosServiceMessage(MSG_CLASS, 0) {}
#if 0
MClass(ceph_fsid_t& f, deque<ClassLibraryIncremental>& e) :
PaxosServiceMessage(MSG_CLASS, 0),
@@ -69,7 +69,7 @@ public:
out << info.size() << " entries";
if (last)
out << "last " << last;
- out << "v " << version << ")";
+ out << ")";
}
void encode_payload() {
diff --git a/src/messages/MClientMount.h b/src/messages/MClientMount.h
index dbd8d40ce99..ab7a6fe71c4 100644
--- a/src/messages/MClientMount.h
+++ b/src/messages/MClientMount.h
@@ -19,7 +19,7 @@
class MClientMount : public PaxosServiceMessage {
public:
- MClientMount() : PaxosServiceMessage(CEPH_MSG_CLIENT_MOUNT, 0) { }
+ MClientMount() : PaxosServiceMessage(CEPH_MSG_CLIENT_MOUNT, VERSION_T) { }
const char *get_type_name() { return "client_mount"; }
diff --git a/src/messages/MClientUnmount.h b/src/messages/MClientUnmount.h
index 05a853f6dd6..cb54b0d39f7 100644
--- a/src/messages/MClientUnmount.h
+++ b/src/messages/MClientUnmount.h
@@ -19,7 +19,7 @@
class MClientUnmount : public PaxosServiceMessage {
public:
- MClientUnmount() : PaxosServiceMessage(CEPH_MSG_CLIENT_UNMOUNT, 0) { }
+ MClientUnmount() : PaxosServiceMessage(CEPH_MSG_CLIENT_UNMOUNT, VERSION_T) { }
const char *get_type_name() { return "client_unmount"; }
diff --git a/src/messages/MGetPoolStats.h b/src/messages/MGetPoolStats.h
index 5365416b143..47529458a61 100644
--- a/src/messages/MGetPoolStats.h
+++ b/src/messages/MGetPoolStats.h
@@ -31,7 +31,7 @@ public:
const char *get_type_name() { return "getpoolstats"; }
void print(ostream& out) {
- out << "getpoolstats(" << tid << " " << pools << ")";
+ out << "getpoolstats(" << tid << " " << pools << "v " << version << ")";
}
void encode_payload() {
diff --git a/src/messages/MGetPoolStatsReply.h b/src/messages/MGetPoolStatsReply.h
index 1dbbbebecdc..40c38fa011f 100644
--- a/src/messages/MGetPoolStatsReply.h
+++ b/src/messages/MGetPoolStatsReply.h
@@ -29,7 +29,7 @@ public:
const char *get_type_name() { return "getpoolstats"; }
void print(ostream& out) {
- out << "getpoolstatsreply(" << tid << ")";
+ out << "getpoolstatsreply(" << tid << "v " << version << ")";
}
void encode_payload() {
diff --git a/src/messages/MLog.h b/src/messages/MLog.h
index c47b75fc42e..d7bd6dcaea3 100644
--- a/src/messages/MLog.h
+++ b/src/messages/MLog.h
@@ -24,15 +24,15 @@ public:
deque<LogEntry> entries;
MLog() : PaxosServiceMessage(MSG_LOG, 0) {}
- MLog(ceph_fsid_t& f, deque<LogEntry>& e, version_t v) : PaxosServiceMessage(MSG_LOG, v), fsid(f), entries(e) { }
- MLog(ceph_fsid_t& f, version_t v) : PaxosServiceMessage(MSG_LOG, v), fsid(f) {}
+ MLog(ceph_fsid_t& f, deque<LogEntry>& e) : PaxosServiceMessage(MSG_LOG, VERSION_T), fsid(f), entries(e) { }
+ MLog(ceph_fsid_t& f) : PaxosServiceMessage(MSG_LOG, VERSION_T), fsid(f) {}
const char *get_type_name() { return "log"; }
void print(ostream& out) {
out << "log(";
if (entries.size())
out << entries.size() << " entries";
- out << "v " << version << ")";
+ out << ")";
}
void encode_payload() {
diff --git a/src/messages/MMDSBeacon.h b/src/messages/MMDSBeacon.h
index 0c10d178a03..1025e2b835c 100644
--- a/src/messages/MMDSBeacon.h
+++ b/src/messages/MMDSBeacon.h
@@ -24,7 +24,7 @@
class MMDSBeacon : public PaxosServiceMessage {
ceph_fsid_t fsid;
string name;
- epoch_t last_epoch_seen; // include last mdsmap epoch mds has seen to avoid race with monitor decree
+
__u32 state;
version_t seq;
__s32 standby_for_rank;
@@ -33,13 +33,13 @@ class MMDSBeacon : public PaxosServiceMessage {
public:
MMDSBeacon() : PaxosServiceMessage(MSG_MDS_BEACON, 0) {}
MMDSBeacon(ceph_fsid_t &f, string& n, epoch_t les, int st, version_t se) :
- PaxosServiceMessage(MSG_MDS_BEACON, se),
- fsid(f), name(n), last_epoch_seen(les), state(st), seq(se),
+ PaxosServiceMessage(MSG_MDS_BEACON, les),
+ fsid(f), name(n), state(st), seq(se),
standby_for_rank(-1) { }
ceph_fsid_t& get_fsid() { return fsid; }
string& get_name() { return name; }
- epoch_t get_last_epoch_seen() { return last_epoch_seen; }
+ epoch_t get_last_epoch_seen() { return version; }
int get_state() { return state; }
version_t get_seq() { return seq; }
const char *get_type_name() { return "mdsbeacon"; }
@@ -53,11 +53,10 @@ class MMDSBeacon : public PaxosServiceMessage {
out << "mdsbeacon(" << name << " " << ceph_mds_state_name(state)
<< " seq " << seq << "v " << version << ")";
}
-
+
void encode_payload() {
paxos_encode();
::encode(fsid, payload);
- ::encode(last_epoch_seen, payload);
::encode(state, payload);
::encode(seq, payload);
::encode(name, payload);
@@ -68,7 +67,6 @@ class MMDSBeacon : public PaxosServiceMessage {
bufferlist::iterator p = payload.begin();
paxos_decode(p);
::decode(fsid, p);
- ::decode(last_epoch_seen, p);
::decode(state, p);
::decode(seq, p);
::decode(name, p);
diff --git a/src/messages/MMDSGetMap.h b/src/messages/MMDSGetMap.h
index 7d4f31ba003..00da930d12d 100644
--- a/src/messages/MMDSGetMap.h
+++ b/src/messages/MMDSGetMap.h
@@ -23,7 +23,7 @@ class MMDSGetMap : public PaxosServiceMessage {
public:
ceph_fsid_t fsid;
- MMDSGetMap() : PaxosServiceMessage(CEPH_MSG_MDS_GETMAP, 0) {}
+ MMDSGetMap() : PaxosServiceMessage(CEPH_MSG_MDS_GETMAP, VERSION_T) {}
MMDSGetMap(ceph_fsid_t &f, epoch_t have=0) :
PaxosServiceMessage(CEPH_MSG_MDS_GETMAP, have),
fsid(f) { }
diff --git a/src/messages/MMonCommand.h b/src/messages/MMonCommand.h
index 2a2fc9660b9..1ba698484be 100644
--- a/src/messages/MMonCommand.h
+++ b/src/messages/MMonCommand.h
@@ -25,7 +25,7 @@ class MMonCommand : public PaxosServiceMessage {
ceph_fsid_t fsid;
vector<string> cmd;
- MMonCommand() : PaxosServiceMessage(MSG_MON_COMMAND, 0) {}
+ MMonCommand() : PaxosServiceMessage(MSG_MON_COMMAND, VERSION_T) {}
MMonCommand(ceph_fsid_t &f, version_t version) :
PaxosServiceMessage(MSG_MON_COMMAND, version),
fsid(f) { }
@@ -37,7 +37,7 @@ class MMonCommand : public PaxosServiceMessage {
if (i) o << ' ';
o << cmd[i];
}
- o << ")";
+ o << " v " << version << ")";
}
void encode_payload() {
diff --git a/src/messages/MMonCommandAck.h b/src/messages/MMonCommandAck.h
index a534c6de0cc..ff708742ebe 100644
--- a/src/messages/MMonCommandAck.h
+++ b/src/messages/MMonCommandAck.h
@@ -23,14 +23,14 @@ class MMonCommandAck : public PaxosServiceMessage {
__s32 r;
string rs;
- MMonCommandAck() : PaxosServiceMessage(MSG_MON_COMMAND_ACK, 0) {}
+ MMonCommandAck() : PaxosServiceMessage(MSG_MON_COMMAND_ACK, VERSION_T) {}
MMonCommandAck(vector<string>& c, int _r, string s, version_t v) :
PaxosServiceMessage(MSG_MON_COMMAND_ACK, v),
cmd(c), r(_r), rs(s) { }
const char *get_type_name() { return "mon_command"; }
void print(ostream& o) {
- o << "mon_command_ack(" << cmd << "=" << r << " " << rs << ")";
+ o << "mon_command_ack(" << cmd << "=" << r << " " << rs << "v " << version << ")";
}
void encode_payload() {
diff --git a/src/messages/MMonPaxos.h b/src/messages/MMonPaxos.h
index 7a06d0492b6..f18083d9d05 100644
--- a/src/messages/MMonPaxos.h
+++ b/src/messages/MMonPaxos.h
@@ -19,7 +19,7 @@
#include "messages/PaxosServiceMessage.h"
#include "mon/mon_types.h"
-class MMonPaxos : public PaxosServiceMessage {
+class MMonPaxos : public Message {
public:
// op types
const static int OP_COLLECT = 1; // proposer: propose round
@@ -58,9 +58,9 @@ class MMonPaxos : public PaxosServiceMessage {
map<version_t,bufferlist> values;
- MMonPaxos() : PaxosServiceMessage(MSG_MON_PAXOS, 0) {}
+ MMonPaxos() : Message(MSG_MON_PAXOS) {}
MMonPaxos(epoch_t e, int o, int mid) :
- PaxosServiceMessage(MSG_MON_PAXOS, e),
+ Message(MSG_MON_PAXOS),
epoch(e),
op(o), machine_id(mid),
first_committed(0), last_committed(0), pn_from(0), pn(0), uncommitted_pn(0),
@@ -76,11 +76,10 @@ class MMonPaxos : public PaxosServiceMessage {
<< " pn " << pn << " opn " << uncommitted_pn;
if (latest_version)
out << " latest " << latest_version << " (" << latest_value.length() << " bytes)";
- out << "v " << version << ")";
+ out << ")";
}
void encode_payload() {
- paxos_encode();
::encode(epoch, payload);
::encode(op, payload);
::encode(machine_id, payload);
@@ -96,7 +95,6 @@ class MMonPaxos : public PaxosServiceMessage {
}
void decode_payload() {
bufferlist::iterator p = payload.begin();
- paxos_decode(p);
::decode(epoch, p);
::decode(op, p);
::decode(machine_id, p);
diff --git a/src/messages/MOSDAlive.h b/src/messages/MOSDAlive.h
index b815d9cd539..7baaf0a75b4 100644
--- a/src/messages/MOSDAlive.h
+++ b/src/messages/MOSDAlive.h
@@ -24,7 +24,7 @@ class MOSDAlive : public PaxosServiceMessage {
epoch_t map_epoch;
MOSDAlive(epoch_t e) : PaxosServiceMessage(MSG_OSD_ALIVE, e), map_epoch(e) { }
- MOSDAlive() : PaxosServiceMessage(MSG_OSD_ALIVE, 0) {}
+ MOSDAlive() : PaxosServiceMessage(MSG_OSD_ALIVE, VERSION_T) {}
void encode_payload() {
paxos_encode();
diff --git a/src/messages/MOSDBoot.h b/src/messages/MOSDBoot.h
index 96650b525e4..f02bdd49c6b 100644
--- a/src/messages/MOSDBoot.h
+++ b/src/messages/MOSDBoot.h
@@ -24,7 +24,7 @@ class MOSDBoot : public PaxosServiceMessage {
public:
OSDSuperblock sb;
- MOSDBoot() : PaxosServiceMessage(){}
+ MOSDBoot() : PaxosServiceMessage( MSG_OSD_BOOT, VERSION_T){}
MOSDBoot(OSDSuperblock& s) :
PaxosServiceMessage(MSG_OSD_BOOT, s.current_epoch), sb(s) {
}
diff --git a/src/messages/MOSDFailure.h b/src/messages/MOSDFailure.h
index 434613690f7..de0b8544223 100644
--- a/src/messages/MOSDFailure.h
+++ b/src/messages/MOSDFailure.h
@@ -25,7 +25,7 @@ class MOSDFailure : public PaxosServiceMessage {
entity_inst_t failed;
epoch_t epoch;
- MOSDFailure() : PaxosServiceMessage(MSG_OSD_FAILURE, 0) {}
+ MOSDFailure() : PaxosServiceMessage(MSG_OSD_FAILURE, VERSION_T) {}
MOSDFailure(ceph_fsid_t &fs, entity_inst_t f, epoch_t e) :
PaxosServiceMessage(MSG_OSD_FAILURE, e),
fsid(fs), failed(f), epoch(e) {}
diff --git a/src/messages/MOSDGetMap.h b/src/messages/MOSDGetMap.h
index 677b49d94b2..67c92969ce7 100644
--- a/src/messages/MOSDGetMap.h
+++ b/src/messages/MOSDGetMap.h
@@ -24,9 +24,9 @@ class MOSDGetMap : public PaxosServiceMessage {
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() : PaxosServiceMessage(CEPH_MSG_OSD_GETMAP, VERSION_T) {}
MOSDGetMap(ceph_fsid_t& f, epoch_t s=0) :
- PaxosServiceMessage(CEPH_MSG_OSD_GETMAP, s-1),
+ PaxosServiceMessage(CEPH_MSG_OSD_GETMAP, s>0 ? s-1 : 0),
fsid(f), start(s) { }
epoch_t get_start_epoch() { return start; }
diff --git a/src/messages/MPGStats.h b/src/messages/MPGStats.h
index 397528cb5be..80f5a9340d6 100644
--- a/src/messages/MPGStats.h
+++ b/src/messages/MPGStats.h
@@ -32,7 +32,7 @@ public:
const char *get_type_name() { return "pg_stats"; }
void print(ostream& out) {
- out << "pg_stats(" << pg_stat.size() << "v " << version << " pgs)";
+ out << "pg_stats(" << pg_stat.size() << " pgs v " << version << ")";
}
void encode_payload() {
diff --git a/src/messages/MPoolSnap.h b/src/messages/MPoolSnap.h
index 7bb571596e8..4ff714b0a05 100644
--- a/src/messages/MPoolSnap.h
+++ b/src/messages/MPoolSnap.h
@@ -26,13 +26,13 @@ public:
string name;
bool create;
- MPoolSnap() : PaxosServiceMessage(MSG_POOLSNAP, 0) {}
+ MPoolSnap() : PaxosServiceMessage(MSG_POOLSNAP, VERSION_T) {}
MPoolSnap( ceph_fsid_t& f, tid_t t, int p, string& n, bool c, version_t v) :
PaxosServiceMessage(MSG_POOLSNAP, v), fsid(f), tid(t), pool(p), name(n), create(c) {}
const char *get_type_name() { return "poolsnap"; }
void print(ostream& out) {
- out << "poolsnap(" << tid << " " << name << ")";
+ out << "poolsnap(" << tid << " " << name << "v " << version << ")";
}
void encode_payload() {
diff --git a/src/messages/MPoolSnapReply.h b/src/messages/MPoolSnapReply.h
index 42422f7b01c..45e0206ac04 100644
--- a/src/messages/MPoolSnapReply.h
+++ b/src/messages/MPoolSnapReply.h
@@ -24,14 +24,14 @@ public:
epoch_t epoch;
- MPoolSnapReply() : PaxosServiceMessage(MSG_POOLSNAPREPLY, 0) {}
+ MPoolSnapReply() : PaxosServiceMessage(MSG_POOLSNAPREPLY, VERSION_T) {}
MPoolSnapReply( ceph_fsid_t& f, tid_t t, int rc, int e, version_t v) :
PaxosServiceMessage(MSG_POOLSNAPREPLY, v), fsid(f), tid(t), replyCode(rc), epoch(e) {}
const char *get_type_name() { return "poolsnapreply"; }
void print(ostream& out) {
- out << "poolsnapreply(" << tid <<")";
+ out << "poolsnapreply(" << tid << "v " << version << ")";
}
void encode_payload() {
diff --git a/src/messages/MRemoveSnaps.h b/src/messages/MRemoveSnaps.h
index 3edfaca8234..9d6820b3071 100644
--- a/src/messages/MRemoveSnaps.h
+++ b/src/messages/MRemoveSnaps.h
@@ -21,12 +21,12 @@ struct MRemoveSnaps : public PaxosServiceMessage {
map<int, vector<snapid_t> > snaps;
MRemoveSnaps() :
- PaxosServiceMessage(MSG_REMOVE_SNAPS, 0) { }
- MRemoveSnaps(map<int, vector<snapid_t> >& s, version_t v) :
- PaxosServiceMessage(MSG_REMOVE_SNAPS, v) {
+ PaxosServiceMessage(MSG_REMOVE_SNAPS, VERSION_T) { }
+ MRemoveSnaps(map<int, vector<snapid_t> >& s) :
+ PaxosServiceMessage(MSG_REMOVE_SNAPS, VERSION_T) {
snaps.swap(s);
}
-
+
const char *get_type_name() { return "remove_snaps"; }
void print(ostream& out) {
out << "remove_snaps(" << snaps << "v " << version << ")";
diff --git a/src/messages/MStatfs.h b/src/messages/MStatfs.h
index 3204cd872df..4f05c3db96b 100644
--- a/src/messages/MStatfs.h
+++ b/src/messages/MStatfs.h
@@ -24,7 +24,7 @@ public:
ceph_fsid_t fsid;
tid_t tid;
- MStatfs() : PaxosServiceMessage(CEPH_MSG_STATFS, 0) {}
+ MStatfs() : PaxosServiceMessage(CEPH_MSG_STATFS, VERSION_T) {}
MStatfs(ceph_fsid_t& f, tid_t t, version_t v) :
PaxosServiceMessage(CEPH_MSG_STATFS, v), fsid(f), tid(t) {}
diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc
index b5d9fa04e3f..7e3d5a51ff4 100644
--- a/src/mon/MDSMonitor.cc
+++ b/src/mon/MDSMonitor.cc
@@ -420,14 +420,14 @@ bool MDSMonitor::preprocess_command(MMonCommand *m)
if (m->cmd[2] == "*") {
for (unsigned i=0; i<mdsmap.get_max_mds(); i++)
if (mdsmap.is_active(i))
- mon->inject_args(mdsmap.get_inst(i), m->cmd[3]);
+ mon->inject_args(mdsmap.get_inst(i), m->cmd[3], paxos->get_version());
r = 0;
ss << "ok bcast";
} else {
errno = 0;
int who = strtol(m->cmd[2].c_str(), 0, 10);
if (!errno && who >= 0 && mdsmap.is_active(who)) {
- mon->inject_args(mdsmap.get_inst(who), m->cmd[3]);
+ mon->inject_args(mdsmap.get_inst(who), m->cmd[3], paxos->get_version());
r = 0;
ss << "ok";
} else
diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc
index 0ebd254df07..e7019ccc924 100644
--- a/src/mon/Monitor.cc
+++ b/src/mon/Monitor.cc
@@ -273,14 +273,14 @@ void Monitor::handle_command(MMonCommand *m)
args[1] = m->cmd[3];
if (m->cmd[2] == "*") {
for (unsigned i=0; i<monmap->size(); i++)
- inject_args(monmap->get_inst(i), args);
+ inject_args(monmap->get_inst(i), args, VERSION_T);
r = 0;
rs = "ok bcast";
} else {
errno = 0;
int who = strtol(m->cmd[2].c_str(), 0, 10);
if (!errno && who >= 0) {
- inject_args(monmap->get_inst(who), args);
+ inject_args(monmap->get_inst(who), args, VERSION_T);
r = 0;
rs = "ok";
} else
@@ -322,10 +322,10 @@ void Monitor::handle_observe(MMonObserve *m)
}
-void Monitor::inject_args(const entity_inst_t& inst, vector<string>& args)
+void Monitor::inject_args(const entity_inst_t& inst, vector<string>& args, version_t version)
{
dout(10) << "inject_args " << inst << " " << args << dendl;
- MMonCommand *c = new MMonCommand(monmap->fsid, VERSION_T);
+ MMonCommand *c = new MMonCommand(monmap->fsid, version);
c->cmd = args;
messenger->send_message(c, inst);
}
diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h
index 418c45313da..f209eda30a9 100644
--- a/src/mon/Monitor.h
+++ b/src/mon/Monitor.h
@@ -135,12 +135,12 @@ public:
void reply_command(MMonCommand *m, int rc, const string &rs, version_t version);
void reply_command(MMonCommand *m, int rc, const string &rs, bufferlist& rdata, version_t version);
- void inject_args(const entity_inst_t& inst, string& args) {
+ void inject_args(const entity_inst_t& inst, string& args, version_t version) {
vector<string> a(1);
a[0] = args;
- inject_args(inst, a);
+ inject_args(inst, a, version);
}
- void inject_args(const entity_inst_t& inst, vector<string>& args);
+ void inject_args(const entity_inst_t& inst, vector<string>& args, version_t version);
public:
struct C_Command : public Context {
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index d9b07d5fc4d..5a1941b48a8 100644
--- a/src/mon/OSDMonitor.cc
+++ b/src/mon/OSDMonitor.cc
@@ -955,14 +955,14 @@ bool OSDMonitor::preprocess_command(MMonCommand *m)
if (m->cmd[2] == "*") {
for (int i=0; i<osdmap.get_max_osd(); i++)
if (osdmap.is_up(i))
- mon->inject_args(osdmap.get_inst(i), m->cmd[3]);
+ mon->inject_args(osdmap.get_inst(i), m->cmd[3], paxos->get_version());
r = 0;
ss << "ok bcast";
} else {
errno = 0;
int who = strtol(m->cmd[2].c_str(), 0, 10);
if (!errno && who >= 0 && osdmap.is_up(who)) {
- mon->inject_args(osdmap.get_inst(who), m->cmd[3]);
+ mon->inject_args(osdmap.get_inst(who), m->cmd[3], paxos->get_version());
r = 0;
ss << "ok";
} else