]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Handle omap and data digests independently
authorDavid Zafman <dzafman@redhat.com>
Thu, 31 May 2018 00:18:03 +0000 (17:18 -0700)
committerDavid Zafman <dzafman@redhat.com>
Fri, 1 Jun 2018 17:16:15 +0000 (10:16 -0700)
Caused by: be078c8b7b131764caa28bc44452b8c5c2339623
The original attempt above to fix the omap_digest handling when
data_digest isn't present had 2 errors.  First, it checked
is_data_digest() and is_omap_digest() instead of digest_present and
omap_digest_present which indicate the source digest is available.
Second, MAYBE could only be set if both digests are available.

Fixes: http://tracker.ceph.com/issues/24366
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 01f9669928abd571e14421a51a749d44fa041337)

src/osd/PGBackend.cc

index 88737ec0dee4a99d74ebb5f9c09083cd61d3bf97..432faa580842ce56d20b6b211c8139d36674e722 100644 (file)
@@ -1058,9 +1058,12 @@ void PGBackend::be_compare_scrubmaps(
        FORCE = 2,
       } update = NO;
 
-      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;
+      if (auth_object.digest_present && !auth_oi.is_data_digest()) {
+       dout(20) << __func__ << " missing data digest on " << *k << dendl;
+       update = MAYBE;
+      }
+      if (auth_object.omap_digest_present && !auth_oi.is_omap_digest()) {
+       dout(20) << __func__ << " missing omap digest on " << *k << dendl;
        update = MAYBE;
       }
 
@@ -1090,13 +1093,14 @@ void PGBackend::be_compare_scrubmaps(
        utime_t age = now - auth_oi.local_mtime;
        if (update == FORCE ||
            age > cct->_conf->osd_deep_scrub_update_digest_min_age) {
-         dout(20) << __func__ << " will update digest on " << *k << dendl;
           boost::optional<uint32_t> data_digest, omap_digest;
-          if (auth_oi.is_data_digest()) {
+          if (auth_object.digest_present) {
             data_digest = auth_object.digest;
+           dout(20) << __func__ << " will update data digest on " << *k << dendl;
           }
-          if (auth_oi.is_omap_digest()) {
+          if (auth_object.omap_digest_present) {
             omap_digest = auth_object.omap_digest;
+           dout(20) << __func__ << " will update omap digest on " << *k << dendl;
           }
          missing_digest[*k] = make_pair(data_digest, omap_digest);
        } else {