Skip to content

Commit

Permalink
MOSDMap: reencode maps if target doesn't have OSDMAP_ENC
Browse files Browse the repository at this point in the history
Reencode both full and incremental maps if target doesn't know how to
decode OSDMAP_ENC maps (CEPH_FEATURE_OSDMAP_ENC bit is not set).  This
fixes a compatibility bug that was introduced in 3d7c69f ("OSDMap:
add a CEPH_FEATURE_OSDMAP_ENC feature, and use new encoding").

Signed-off-by: Ilya Dryomov <[email protected]>
  • Loading branch information
idryomov committed Jan 22, 2014
1 parent 54caa01 commit 8060afd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/messages/MOSDMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ class MOSDMap : public Message {
::encode(fsid, payload);
if ((features & CEPH_FEATURE_PGID64) == 0 ||
(features & CEPH_FEATURE_PGPOOL3) == 0 ||
(features & CEPH_FEATURE_OSDENC) == 0) {
(features & CEPH_FEATURE_OSDENC) == 0 ||
(features & CEPH_FEATURE_OSDMAP_ENC) == 0) {
if ((features & CEPH_FEATURE_PGID64) == 0 ||
(features & CEPH_FEATURE_PGPOOL3) == 0)
header.version = 1; // old old_client version
else
else if ((features & CEPH_FEATURE_OSDENC) == 0)
header.version = 2; // old pg_pool_t

// reencode maps using old format
Expand Down

0 comments on commit 8060afd

Please sign in to comment.