From: Sage Weil Date: Wed, 10 Dec 2014 00:28:52 +0000 (-0800) Subject: osd: scrub: share auth oi with caller and be_compare_scrub_objects X-Git-Tag: v0.92~111^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cf3b04764d118db09bb9a7511016070f5d85f042;p=ceph.git osd: scrub: share auth oi with caller and be_compare_scrub_objects Signed-off-by: Sage Weil --- diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 4491b3eb4341..d931c79d35b9 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -371,7 +371,9 @@ void PGBackend::be_scan_list( } enum scrub_error_type PGBackend::be_compare_scrub_objects( + pg_shard_t auth_shard, const ScrubMap::object &auth, + const object_info_t& auth_oi, const ScrubMap::object &candidate, ostream &errorstream) { @@ -442,7 +444,8 @@ enum scrub_error_type PGBackend::be_compare_scrub_objects( map::const_iterator PGBackend::be_select_auth_object( const hobject_t &obj, - const map &maps) + const map &maps, + object_info_t *auth_oi) { map::const_iterator auth = maps.end(); for (map::const_iterator j = maps.begin(); @@ -498,6 +501,7 @@ map::const_iterator dout(10) << __func__ << ": selecting osd " << j->first << " for obj " << obj << dendl; + *auth_oi = oi; auth = j; } return auth; @@ -528,8 +532,9 @@ void PGBackend::be_compare_scrubmaps( for (set::const_iterator k = master_set.begin(); k != master_set.end(); ++k) { + object_info_t auth_oi; map::const_iterator auth = - be_select_auth_object(*k, maps); + be_select_auth_object(*k, maps, &auth_oi); if (auth == maps.end()) { // Something is better than nothing // TODO: something is NOT better than nothing, do something like @@ -551,9 +556,12 @@ void PGBackend::be_compare_scrubmaps( if (j->second->objects.count(*k)) { // Compare stringstream ss; - enum scrub_error_type error = be_compare_scrub_objects(auth->second->objects[*k], - j->second->objects[*k], - ss); + enum scrub_error_type error = + be_compare_scrub_objects(auth->first, + auth->second->objects[*k], + auth_oi, + j->second->objects[*k], + ss); if (error != CLEAN) { cur_inconsistent.insert(j->first); if (error == SHALLOW_ERROR) diff --git a/src/osd/PGBackend.h b/src/osd/PGBackend.h index c829b9468a61..561d512c740e 100644 --- a/src/osd/PGBackend.h +++ b/src/osd/PGBackend.h @@ -588,12 +588,15 @@ ScrubMap &map, const vector &ls, bool deep, uint32_t seed, ThreadPool::TPHandle &handle); enum scrub_error_type be_compare_scrub_objects( + pg_shard_t auth_shard, const ScrubMap::object &auth, + const object_info_t& auth_oi, const ScrubMap::object &candidate, ostream &errorstream); map::const_iterator be_select_auth_object( const hobject_t &obj, - const map &maps); + const map &maps, + object_info_t *auth_oi); void be_compare_scrubmaps( const map &maps, map > &missing,