summaryrefslogtreecommitdiff
path: root/src/messages
diff options
context:
space:
mode:
authorGreg Farnum <gregory.farnum@dreamhost.com>2012-02-23 14:55:48 -0800
committerGreg Farnum <gregory.farnum@dreamhost.com>2012-02-23 14:55:48 -0800
commitddc99983228e761f754e0038aecbe341d7e2181f (patch)
tree88ae6fb621e02070f965632e2678d7f2d82cba2e /src/messages
parentb205c64c687cee1b1728877f14df050c3ce397da (diff)
downloadceph-ddc99983228e761f754e0038aecbe341d7e2181f.tar.gz
osd: conditionally encode old pg_pool_t when no CEPH_FEATURE_OSDENC
This fixes OSDMap compatibility between v0.42 and <v0.42. For MOSDMap, reencode maps if OSDENC feature is missing. Also rev the message version. We don't use COMPAT version here because v3 can't be understood by v2 (that's why we're checking feature bits). (It will be possible to do that later when our constituent types can be decoded by multiple versions.) Fixes: #2095 Signed-off-by: Sage Weil <sage@newdream.net> Reviewed-by: Greg Farnum <gregory.farnum@dreamhost.com>
Diffstat (limited to 'src/messages')
-rw-r--r--src/messages/MOSDMap.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/messages/MOSDMap.h b/src/messages/MOSDMap.h
index f7838f7b7ae..cd4a9519e1d 100644
--- a/src/messages/MOSDMap.h
+++ b/src/messages/MOSDMap.h
@@ -22,7 +22,7 @@
class MOSDMap : public Message {
- static const int HEAD_VERSION = 2;
+ static const int HEAD_VERSION = 3;
public:
uuid_d fsid;
@@ -85,8 +85,13 @@ public:
void encode_payload(uint64_t features) {
::encode(fsid, payload);
if ((features & CEPH_FEATURE_PGID64) == 0 ||
- (features & CEPH_FEATURE_PGPOOL3) == 0) {
- header.version = 1;
+ (features & CEPH_FEATURE_PGPOOL3) == 0 ||
+ (features & CEPH_FEATURE_OSDENC) == 0) {
+ if ((features & CEPH_FEATURE_PGID64) == 0 ||
+ (features & CEPH_FEATURE_PGPOOL3) == 0)
+ header.version = 1; // old old_client version
+ else
+ header.version = 2; // old pg_pool_t
// reencode maps using old format
//