From 82f452cc7deab0d2f667137a42dfc8363d6ae86e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 5 Dec 2014 13:43:52 -0800 Subject: [PATCH] osd/PG: drop PG/collection attrs from ScrubMap The collection attrs are often version specific. We should compare the semantic PG metadata, if anything, not these! Signed-off-by: Sage Weil --- src/osd/PG.cc | 2 -- src/osd/osd_types.cc | 18 +++++------------- src/osd/osd_types.h | 1 - 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index d9fe3abe86cdf..734318215ec5c 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3584,8 +3584,6 @@ int PG::build_scrub_map_chunk( _scan_rollback_obs(rollback_obs, handle); _scan_snaps(map); - // pg attrs - osd->store->collection_getattrs(coll, map.attrs); dout(10) << __func__ << " done." << dendl; return 0; diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 1002da7a9742f..5dbc0947faf8c 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -4401,7 +4401,6 @@ uint64_t PushOp::cost(CephContext *cct) const void ScrubMap::merge_incr(const ScrubMap &l) { assert(valid_through == l.incr_since); - attrs = l.attrs; valid_through = l.valid_through; for (map::const_iterator p = l.objects.begin(); @@ -4422,7 +4421,7 @@ void ScrubMap::encode(bufferlist& bl) const { ENCODE_START(3, 2, bl); ::encode(objects, bl); - ::encode(attrs, bl); + ::encode((__u32)0, bl); // used to be attrs; now deprecated bufferlist old_logbl; // not used ::encode(old_logbl, bl); ::encode(valid_through, bl); @@ -4434,7 +4433,10 @@ void ScrubMap::decode(bufferlist::iterator& bl, int64_t pool) { DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl); ::decode(objects, bl); - ::decode(attrs, bl); + { + map attrs; // deprecated + ::decode(attrs, bl); + } bufferlist old_logbl; // not used ::decode(old_logbl, bl); ::decode(valid_through, bl); @@ -4460,14 +4462,6 @@ void ScrubMap::dump(Formatter *f) const { f->dump_stream("valid_through") << valid_through; f->dump_stream("incremental_since") << incr_since; - f->open_array_section("attrs"); - for (map::const_iterator p = attrs.begin(); p != attrs.end(); ++p) { - f->open_object_section("attr"); - f->dump_string("name", p->first); - f->dump_int("length", p->second.length()); - f->close_section(); - } - f->close_section(); f->open_array_section("objects"); for (map::const_iterator p = objects.begin(); p != objects.end(); ++p) { f->open_object_section("object"); @@ -4487,8 +4481,6 @@ void ScrubMap::generate_test_instances(list& o) o.push_back(new ScrubMap); o.back()->valid_through = eversion_t(1, 2); o.back()->incr_since = eversion_t(3, 4); - o.back()->attrs["foo"] = buffer::copy("foo", 3); - o.back()->attrs["bar"] = buffer::copy("barval", 6); list obj; object::generate_test_instances(obj); o.back()->objects[hobject_t(object_t("foo"), "fookey", 123, 456, 0, "")] = *obj.back(); diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index ad4459565c8dc..be91f9b677f02 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -3303,7 +3303,6 @@ struct ScrubMap { WRITE_CLASS_ENCODER(object) map objects; - map attrs; eversion_t valid_through; eversion_t incr_since; -- 2.39.5