diff options
author | Samuel Just <sam.just@inktank.com> | 2012-06-20 12:55:38 -0700 |
---|---|---|
committer | Samuel Just <sam.just@inktank.com> | 2012-06-21 17:10:29 -0700 |
commit | 2fe9816305fc1406ab7fb043bbb32affffc2d190 (patch) | |
tree | a830b2ffb9787f2e4fedb992e490c219fded2ec4 /src/messages | |
parent | 448f5b02b10f76cc2cd93558a92d7690d60fb74b (diff) | |
download | ceph-2fe9816305fc1406ab7fb043bbb32affffc2d190.tar.gz |
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')
-rw-r--r-- | src/messages/MOSDPGBackfill.h | 5 | ||||
-rw-r--r-- | src/messages/MOSDPGLog.h | 4 | ||||
-rw-r--r-- | src/messages/MOSDPGMissing.h | 2 | ||||
-rw-r--r-- | src/messages/MOSDPGScan.h | 6 | ||||
-rw-r--r-- | src/messages/MOSDSubOp.h | 17 | ||||
-rw-r--r-- | src/messages/MOSDSubOpReply.h | 3 |
6 files changed, 31 insertions, 6 deletions
diff --git a/src/messages/MOSDPGBackfill.h b/src/messages/MOSDPGBackfill.h index 7e6c45e1e9a..bc2a696b6ce 100644 --- a/src/messages/MOSDPGBackfill.h +++ b/src/messages/MOSDPGBackfill.h @@ -48,6 +48,11 @@ public: ::decode(pgid, p); ::decode(last_backfill, p); ::decode(stats, p); + + // Handle hobject_t format change + if (!last_backfill.is_max() && + last_backfill.pool == -1) + last_backfill.pool = pgid.pool(); } virtual void encode_payload(uint64_t features) { diff --git a/src/messages/MOSDPGLog.h b/src/messages/MOSDPGLog.h index b296fb3997d..53358d68cdf 100644 --- a/src/messages/MOSDPGLog.h +++ b/src/messages/MOSDPGLog.h @@ -70,8 +70,8 @@ public: bufferlist::iterator p = payload.begin(); ::decode(epoch, p); ::decode(info, p); - ::decode(log, p); - ::decode(missing, p); + log.decode(p, info.pgid.pool()); + missing.decode(p, info.pgid.pool()); if (header.version >= 2) { ::decode(query_epoch, p); } diff --git a/src/messages/MOSDPGMissing.h b/src/messages/MOSDPGMissing.h index 024414b3791..b931b36353f 100644 --- a/src/messages/MOSDPGMissing.h +++ b/src/messages/MOSDPGMissing.h @@ -50,7 +50,7 @@ public: bufferlist::iterator p = payload.begin(); ::decode(epoch, p); ::decode(info, p); - ::decode(missing, p); + missing.decode(p, info.pgid.pool()); } }; diff --git a/src/messages/MOSDPGScan.h b/src/messages/MOSDPGScan.h index cc69b92e170..7df3a966dba 100644 --- a/src/messages/MOSDPGScan.h +++ b/src/messages/MOSDPGScan.h @@ -45,6 +45,12 @@ public: ::decode(pgid, p); ::decode(begin, p); ::decode(end, p); + + // handle hobject_t format upgrade + if (begin.pool == -1) + begin.pool = pgid.pool(); + if (end.pool == -1) + end.pool = pgid.pool(); } virtual void encode_payload(uint64_t features) { 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); } diff --git a/src/messages/MOSDSubOpReply.h b/src/messages/MOSDSubOpReply.h index fc2d7717eab..d577dd3c2d3 100644 --- a/src/messages/MOSDSubOpReply.h +++ b/src/messages/MOSDSubOpReply.h @@ -68,6 +68,9 @@ public: ::decode(last_complete_ondisk, p); ::decode(peer_stat, p); ::decode(attrset, p); + + if (poid.pool == -1) + poid.pool = pgid.pool(); } virtual void encode_payload(uint64_t features) { ::encode(map_epoch, payload); |