]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: move recorded vs on disk digest warning into be_compare_scrubmaps
authorSage Weil <sage@redhat.com>
Thu, 26 Mar 2015 20:52:20 +0000 (13:52 -0700)
committerDavid Zafman <dzafman@redhat.com>
Tue, 4 Aug 2015 14:39:00 +0000 (07:39 -0700)
This is a better place for it.  While we are here, change the wording to
clearly call out the 'recorded' digest (from object_info_t) vs the 'on
disk' digest (what we observed during scrub).

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit cf349ff35e9111ca52db1b0aad3753d0680b486d)

src/osd/PGBackend.cc
src/osd/ReplicatedPG.cc

index ada84a6d3d0fd9f61eacb6484b0e08d9594e9b78..8c7d16e77931580185782c9e98b1f960e6b892f4 100644 (file)
@@ -628,21 +628,48 @@ void PGBackend::be_compare_scrubmaps(
     if (!cur_inconsistent.empty() || !cur_missing.empty()) {
       authoritative[*k] = auth_list;
     }
-    if (clean &&
-       okseed &&
-       parent->get_pool().is_replicated() &&
-       auth_object.digest_present && auth_object.omap_digest_present &&
-       (!auth_oi.is_data_digest() || !auth_oi.is_omap_digest() ||
-        (g_conf->osd_debug_scrub_chance_rewrite_digest &&
+
+    if (okseed &&
+       clean &&
+       parent->get_pool().is_replicated()) {
+      enum {
+       NO = 0,
+       MAYBE = 1,
+       FORCE = 2,
+      } update = NO;
+
+      // recorded digest != actual digest?
+      if (auth_oi.is_data_digest() && auth_object.digest_present &&
+         auth_oi.data_digest != auth_object.digest) {
+       ++deep_errors;
+       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 (auth_oi.is_omap_digest() && auth_object.omap_digest_present &&
+         auth_oi.omap_digest != auth_object.omap_digest) {
+       ++deep_errors;
+       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 (auth_object.digest_present && auth_object.omap_digest_present &&
+         (!auth_oi.is_data_digest() || !auth_oi.is_omap_digest())) {
+       dout(20) << __func__ << " missing digest on " << *k << dendl;
+       update = MAYBE;
+      }
+      if (g_conf->osd_debug_scrub_chance_rewrite_digest &&
          (((unsigned)rand() % 100) >
-           g_conf->osd_debug_scrub_chance_rewrite_digest)))) {
-      if (!cur_inconsistent.empty() || !cur_missing.empty()) {
-       dout(20) << __func__ << " not updating oi digest on "
-                << *k << " since it is inconsistent" << dendl;
-      } else {
+          g_conf->osd_debug_scrub_chance_rewrite_digest)) {
+       dout(20) << __func__ << " randomly updating digest on " << *k << dendl;
+       update = MAYBE;
+      }
+      if (update != NO) {
        utime_t age = now - auth_oi.local_mtime;
-       if (age > g_conf->osd_deep_scrub_update_digest_min_age) {
-         dout(20) << __func__ << " noting missing digest on " << *k << dendl;
+       if (update == FORCE ||
+           age > g_conf->osd_deep_scrub_update_digest_min_age) {
+         dout(20) << __func__ << " will update digest on " << *k << dendl;
          missing_digest[*k] = make_pair(auth_object.digest,
                                         auth_object.omap_digest);
        } else {
index 4da2224233cc9219d1a96e93ac7fd598bfde5f62..34575abb6c196eece3517b9ab547be2a2fc2b55b 100644 (file)
@@ -11251,26 +11251,6 @@ void ReplicatedPG::_scrub(
 
     dout(20) << mode << "  " << soid << " " << oi << dendl;
 
-    if (pool.info.is_replicated() &&
-       (get_min_peer_features() & CEPH_FEATURE_OSD_OBJECT_DIGEST)) {
-      if (oi.is_data_digest() && p->second.digest_present &&
-         oi.data_digest != p->second.digest) {
-       osd->clog->error() << mode << " " << info.pgid << " " << soid
-                          << " on disk data digest 0x" << std::hex
-                          << p->second.digest << " != 0x"
-                          << oi.data_digest << std::dec;
-       ++scrubber.deep_errors;
-      }
-      if (oi.is_omap_digest() && p->second.omap_digest_present &&
-         oi.omap_digest != p->second.omap_digest) {
-       osd->clog->error() << mode << " " << info.pgid << " " << soid
-                          << " on disk omap digest 0x" << std::hex
-                          << p->second.omap_digest << " != 0x"
-                          << oi.omap_digest << std::dec;
-       ++scrubber.deep_errors;
-      }
-    }
-
     if (soid.is_snap()) {
       stat.num_bytes += snapset.get_clone_bytes(soid.snap);
     } else {