]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: repair record digest if all replicas match but do not match
authorSage Weil <sage@redhat.com>
Fri, 27 Mar 2015 17:20:23 +0000 (10:20 -0700)
committerSage Weil <sage@redhat.com>
Tue, 7 Apr 2015 18:42:14 +0000 (11:42 -0700)
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 <sage@redhat.com>
src/osd/PG.cc
src/osd/PGBackend.cc
src/osd/PGBackend.h

index cd2d79ecf8989e33b92da3125ef7ed7ce95c6a1a..593e650ef3502e9835aa82e1e484cb885553acc4 100644 (file)
@@ -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,
index 8c7d16e77931580185782c9e98b1f960e6b892f4..fe3a80dceb92a84e84857f7b45e18a1afb9bfde7 100644 (file)
@@ -540,6 +540,7 @@ map<pg_shard_t, ScrubMap *>::const_iterator
 void PGBackend::be_compare_scrubmaps(
   const map<pg_shard_t,ScrubMap*> &maps,
   bool okseed,
+  bool repair,
   map<hobject_t, set<pg_shard_t> > &missing,
   map<hobject_t, set<pg_shard_t> > &inconsistent,
   map<hobject_t, list<pg_shard_t> > &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 &&
index 91b4d105fca6c29abfa75e0b1db400c40855b080..d1bf105da23c1a7ed6809469cf01af3b18cac26b 100644 (file)
    void be_compare_scrubmaps(
      const map<pg_shard_t,ScrubMap*> &maps,
      bool okseed,   ///< true if scrub digests have same seed our oi digests
+     bool repair,
      map<hobject_t, set<pg_shard_t> > &missing,
      map<hobject_t, set<pg_shard_t> > &inconsistent,
      map<hobject_t, list<pg_shard_t> > &authoritative,