From cf3b04764d118db09bb9a7511016070f5d85f042 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 9 Dec 2014 16:28:52 -0800 Subject: osd: scrub: share auth oi with caller and be_compare_scrub_objects Signed-off-by: Sage Weil --- src/osd/PGBackend.cc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/osd/PGBackend.cc') diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 4491b3eb434..d931c79d35b 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) -- cgit v1.2.3