From: David Zafman Date: Wed, 26 Jul 2017 23:22:26 +0000 (-0700) Subject: osd: In scrub's be_select_auth_object() detect multiple errors better X-Git-Tag: v13.0.0~81^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=75b425671a75c80ed95a52820cabf25d3fafcfff;p=ceph.git osd: In scrub's be_select_auth_object() detect multiple errors better Signed-off-by: David Zafman --- diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 312bda520fa2..a1adce752be9 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -817,6 +817,25 @@ map::const_iterator goto out; } + // We won't pick an auth copy if the snapset is missing or won't decode. + if (obj.is_head() || obj.is_snapdir()) { + k = i->second.attrs.find(SS_ATTR); + if (k == i->second.attrs.end()) { + shard_info.set_ss_attr_missing(); + error_string += " ss_attr_missing"; + } else { + ss_bl.push_back(k->second); + try { + bufferlist::iterator bliter = ss_bl.begin(); + ::decode(ss, bliter); + } catch (...) { + // invalid snapset, probably corrupt + shard_info.set_ss_attr_corrupted(); + error_string += " ss_attr_corrupted"; + } + } + } + k = i->second.attrs.find(OI_ATTR); if (k == i->second.attrs.end()) { // no object info on object, probably corrupt @@ -849,32 +868,11 @@ map::const_iterator dout(5) << __func__ << " size " << i->second.size << " oi size " << oi.size << dendl; shard_info.set_obj_size_oi_mismatch(); error_string += " obj_size_oi_mismatch"; - goto out; - } - - // We won't pick an auth copy if the snapset is missing or won't decode. - if (obj.is_head() || obj.is_snapdir()) { - k = i->second.attrs.find(SS_ATTR); - if (k == i->second.attrs.end()) { - shard_info.set_ss_attr_missing(); - error_string += " ss_attr_missing"; - goto out; - } - ss_bl.push_back(k->second); - try { - bufferlist::iterator bliter = ss_bl.begin(); - ::decode(ss, bliter); - } catch (...) { - // invalid snapset, probably corrupt - shard_info.set_ss_attr_corrupted(); - error_string += " ss_attr_corrupted"; - goto out; - } } - // Don't use this particular shard because it won't be able to repair data - // XXX: For now we can't pick one shard for repair and another's object info - if (i->second.read_error || i->second.ec_hash_mismatch || i->second.ec_size_mismatch) + // Don't use this particular shard due to previous errors + // XXX: For now we can't pick one shard for repair and another's object info or snapset + if (shard_info.errors) goto out; if (auth_version == eversion_t() || oi.version > auth_version ||