summaryrefslogtreecommitdiffstats
path: root/src/messages/MOSDSubOp.h
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2012-06-20 21:55:38 +0200
committerSamuel Just <sam.just@inktank.com>2012-06-22 02:10:29 +0200
commit2fe9816305fc1406ab7fb043bbb32affffc2d190 (patch)
treea830b2ffb9787f2e4fedb992e490c219fded2ec4 /src/messages/MOSDSubOp.h
parentlogrotate: reload all upstart instances (diff)
downloadceph-2fe9816305fc1406ab7fb043bbb32affffc2d190.tar.xz
ceph-2fe9816305fc1406ab7fb043bbb32affffc2d190.zip
OSD,PG,ObjectStore: handle messages with old hobject_t encoding
Messages that embed an hobject_t need to have the pool field fixed on messages from old peers. Signed-off-by: Samuel Just <sam.just@inktank.com>
Diffstat (limited to 'src/messages/MOSDSubOp.h')
-rw-r--r--src/messages/MOSDSubOp.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/messages/MOSDSubOp.h b/src/messages/MOSDSubOp.h
index a92449a9309..3da997dc8df 100644
--- a/src/messages/MOSDSubOp.h
+++ b/src/messages/MOSDSubOp.h
@@ -25,7 +25,7 @@
class MOSDSubOp : public Message {
- static const int HEAD_VERSION = 6;
+ static const int HEAD_VERSION = 7;
static const int COMPAT_VERSION = 1;
public:
@@ -83,6 +83,9 @@ public:
map<string,bufferlist> omap_entries;
bufferlist omap_header;
+ // indicates that we must fix hobject_t encoding
+ bool hobject_incorrect_pool;
+
virtual void decode_payload() {
bufferlist::iterator p = payload.begin();
::decode(map_epoch, p);
@@ -125,7 +128,7 @@ public:
::decode(oloc, p);
if (header.version >= 4) {
::decode(data_included, p);
- ::decode(recovery_info, p);
+ recovery_info.decode(p, pgid.pool());
::decode(recovery_progress, p);
::decode(current_progress, p);
}
@@ -133,6 +136,13 @@ public:
::decode(omap_entries, p);
if (header.version >= 6)
::decode(omap_header, p);
+
+ if (header.version < 7) {
+ // Handle hobject_t format change
+ if (poid.pool == -1)
+ poid.pool = pgid.pool();
+ hobject_incorrect_pool = true;
+ }
}
virtual void encode_payload(uint64_t features) {
@@ -192,7 +202,8 @@ public:
noop(noop_),
old_exists(false), old_size(0),
version(v),
- first(false), complete(false) {
+ first(false), complete(false),
+ hobject_incorrect_pool(false) {
memset(&peer_stat, 0, sizeof(peer_stat));
set_tid(rtid);
}