From: Loic Dachary Date: Sun, 16 Mar 2014 12:27:51 +0000 (+0100) Subject: osd: obsolete pg_pool_t properties with erasure_code_profile X-Git-Tag: v0.79~136^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=063de51e883928e07a8f5560e4ff444c8c4147ff;p=ceph.git osd: obsolete pg_pool_t properties with erasure_code_profile The generic map properties is only used for erasure code and should be specialized. It is obsoleted by a string that can be looked up in OSDMap::erasure_code_profiles to retrieve the key/value pairs that will be interpreted by the erasure code plugin. Signed-off-by: Loic Dachary --- diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 9219602007cd..f57ab0cf242b 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -785,14 +785,7 @@ void pg_pool_t::dump(Formatter *f) const cache_target_full_ratio_micro); f->dump_unsigned("cache_min_flush_age", cache_min_flush_age); f->dump_unsigned("cache_min_evict_age", cache_min_evict_age); - f->open_object_section("properties"); - for (map::const_iterator i = properties.begin(); - i != properties.end(); - ++i) { - string name = i->first; - f->dump_string(name.c_str(), i->second); - } - f->close_section(); + f->dump_string("erasure_code_profile", erasure_code_profile); f->open_object_section("hit_set_params"); hit_set_params.dump(f); f->close_section(); // hit_set_params @@ -1050,7 +1043,7 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const } __u8 encode_compat = 5; - ENCODE_START(13, encode_compat, bl); + ENCODE_START(14, encode_compat, bl); ::encode(type, bl); ::encode(size, bl); ::encode(crush_ruleset, bl); @@ -1090,12 +1083,13 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const ::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_NEW_COMPAT(bl, encode_compat); } void pg_pool_t::decode(bufferlist::iterator& bl) { - DECODE_START_LEGACY_COMPAT_LEN(13, 5, 5, bl); + DECODE_START_LEGACY_COMPAT_LEN(14, 5, 5, bl); ::decode(type, bl); ::decode(size, bl); ::decode(crush_ruleset, bl); @@ -1189,6 +1183,9 @@ void pg_pool_t::decode(bufferlist::iterator& bl) cache_min_flush_age = 0; cache_min_evict_age = 0; } + if (struct_v >= 14) { + ::decode(erasure_code_profile, bl); + } DECODE_FINISH(bl); calc_pg_masks(); @@ -1231,8 +1228,6 @@ void pg_pool_t::generate_test_instances(list& o) a.cache_mode = CACHEMODE_WRITEBACK; a.read_tier = 1; a.write_tier = 1; - a.properties["p-1"] = "v-1"; - a.properties["empty"] = string(); a.hit_set_params = HitSet::Params(new BloomHitSet::Params); a.hit_set_period = 3600; a.hit_set_count = 8; @@ -1243,6 +1238,7 @@ void pg_pool_t::generate_test_instances(list& o) a.cache_target_full_ratio_micro = 987222; a.cache_min_flush_age = 231; a.cache_min_evict_age = 2321; + a.erasure_code_profile = "profile in osdmap"; o.push_back(new pg_pool_t(a)); } diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index af9e6fe8447d..e055281ccea5 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -878,7 +878,8 @@ private: public: - map properties; ///< interpreted according to the pool type + map properties; ///< OBSOLETE + string erasure_code_profile; ///< name of the erasure code profile in OSDMap epoch_t last_change; ///< most recent epoch changed, exclusing snapshot changes snapid_t snap_seq; ///< seq for per-pool snapshot epoch_t snap_epoch; ///< osdmap epoch of last snap