From 712d5d1e2989e67635576c21421af74b96a0f84c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 11 Jul 2014 11:29:05 -0700 Subject: [PATCH 1/2] osd/osd_types: remove useless encode_compat local var for pg_pool_t::encode This is left over from db3fd1152a87f8f152facdf141f8367296b371df when we made the HitSet stuff incompat, but that behavior was reverted by dc3ce58add130ca5a0a20b097b0ac934a1b486c7, leaving this cruft behind. Signed-off-by: Sage Weil --- src/osd/osd_types.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index d8532bbdd7d..3513f92dae4 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -1060,8 +1060,7 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const return; } - __u8 encode_compat = 5; - ENCODE_START(15, encode_compat, bl); + ENCODE_START(15, 5, bl); ::encode(type, bl); ::encode(size, bl); ::encode(crush_ruleset, bl); From c93da05bd3dd6b73e8cfa182c6349359b042717c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 11 Jul 2014 11:31:22 -0700 Subject: [PATCH 2/2] osd/osd_types: be pedantic about encoding last_force_op_resend without feature bit The addition of the value is completely backward compatible, but if the mon feature bits don't match it can cause monitor scrub noice (due to the parallel OSDMap encoding). Avoid that by only adding the new field if the feature (which was added 2 patches after the encoding, see 3152faf79f498a723ae0fe44301ccb21b15a96ab and 45e79a17a932192995f8328ae9f6e8a2a6348d10. Fixes: #8815 Backport: firefly Signed-off-by: Sage Weil --- src/osd/osd_types.cc | 49 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 3513f92dae4..18ebbfd270e 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -1060,6 +1060,55 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const return; } + if ((features & CEPH_FEATURE_OSD_POOLRESEND) == 0) { + // we simply added last_force_op_resend here, which is a fully + // backward compatible change. however, encoding the same map + // differently between monitors triggers scrub noise (even though + // they are decodable without the feature), so let's be pendantic + // about it. + ENCODE_START(14, 5, bl); + ::encode(type, bl); + ::encode(size, bl); + ::encode(crush_ruleset, bl); + ::encode(object_hash, bl); + ::encode(pg_num, bl); + ::encode(pgp_num, bl); + __u32 lpg_num = 0, lpgp_num = 0; // tell old code that there are no localized pgs. + ::encode(lpg_num, bl); + ::encode(lpgp_num, bl); + ::encode(last_change, bl); + ::encode(snap_seq, bl); + ::encode(snap_epoch, bl); + ::encode(snaps, bl, features); + ::encode(removed_snaps, bl); + ::encode(auid, bl); + ::encode(flags, bl); + ::encode(crash_replay_interval, bl); + ::encode(min_size, bl); + ::encode(quota_max_bytes, bl); + ::encode(quota_max_objects, bl); + ::encode(tiers, bl); + ::encode(tier_of, bl); + __u8 c = cache_mode; + ::encode(c, bl); + ::encode(read_tier, bl); + ::encode(write_tier, bl); + ::encode(properties, bl); + ::encode(hit_set_params, bl); + ::encode(hit_set_period, bl); + ::encode(hit_set_count, bl); + ::encode(stripe_width, bl); + ::encode(target_max_bytes, bl); + ::encode(target_max_objects, bl); + ::encode(cache_target_dirty_ratio_micro, bl); + ::encode(cache_target_full_ratio_micro, bl); + ::encode(cache_min_flush_age, bl); + ::encode(cache_min_evict_age, bl); + ::encode(erasure_code_profile, bl); + ENCODE_FINISH(bl); + return; + } + ENCODE_START(15, 5, bl); ::encode(type, bl); ::encode(size, bl);