summaryrefslogtreecommitdiffstats
path: root/src/messages
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 /src/messages
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.
Diffstat (limited to 'src/messages')
-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
20 files changed, 38 insertions, 42 deletions
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) {}