From: Sage Weil Date: Fri, 27 Mar 2015 17:20:23 +0000 (-0700) Subject: osd: repair record digest if all replicas match but do not match X-Git-Tag: v0.94.4~79^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d4f4c5c4334add6acfc66407c2383d01094d384d;p=ceph.git osd: repair record digest if all replicas match but do not match If the recorded digest does not match the replicas, and all replicas match, then (on repair) fix the recorded digest. Signed-off-by: Sage Weil (cherry picked from commit f581fecd8a16b9250fa96beec5aa26074f401028) --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 4e898cca178..ee8557fd255 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -4196,6 +4196,7 @@ void PG::scrub_compare_maps() get_pgbackend()->be_compare_scrubmaps( maps, okseed, + state_test(PG_STATE_REPAIR), scrubber.missing, scrubber.inconsistent, authoritative, diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 8c7d16e7793..fe3a80dceb9 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -540,6 +540,7 @@ map::const_iterator void PGBackend::be_compare_scrubmaps( const map &maps, bool okseed, + bool repair, map > &missing, map > &inconsistent, map > &authoritative, @@ -645,6 +646,8 @@ void PGBackend::be_compare_scrubmaps( errorstream << __func__ << ": " << pgid << " recorded data digest 0x" << std::hex << auth_oi.data_digest << " != on disk 0x" << auth_object.digest << std::dec << " on " << auth_oi.soid; + if (repair) + update = FORCE; } if (auth_oi.is_omap_digest() && auth_object.omap_digest_present && auth_oi.omap_digest != auth_object.omap_digest) { @@ -652,6 +655,8 @@ void PGBackend::be_compare_scrubmaps( errorstream << __func__ << ": " << pgid << " recorded omap digest 0x" << std::hex << auth_oi.data_digest << " != on disk 0x" << auth_object.digest << std::dec << " on " << auth_oi.soid; + if (repair) + update = FORCE; } if (auth_object.digest_present && auth_object.omap_digest_present && diff --git a/src/osd/PGBackend.h b/src/osd/PGBackend.h index 91b4d105fca..d1bf105da23 100644 --- a/src/osd/PGBackend.h +++ b/src/osd/PGBackend.h @@ -606,6 +606,7 @@ void be_compare_scrubmaps( const map &maps, bool okseed, ///< true if scrub digests have same seed our oi digests + bool repair, map > &missing, map > &inconsistent, map > &authoritative,