From f581fecd8a16b9250fa96beec5aa26074f401028 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 27 Mar 2015 10:20:23 -0700 Subject: [PATCH] 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 --- src/osd/PG.cc | 1 + src/osd/PGBackend.cc | 5 +++++ src/osd/PGBackend.h | 1 + 3 files changed, 7 insertions(+) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index cd2d79ecf898..593e650ef350 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -4181,6 +4181,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 8c7d16e77931..fe3a80dceb92 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 91b4d105fca6..d1bf105da23c 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, -- 2.47.3