]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix deep scrub with osd_skip_data_digest=true (default) and bluestore 23094/head
authorSage Weil <sage@redhat.com>
Sat, 14 Jul 2018 17:39:15 +0000 (12:39 -0500)
committerAbhishek Lekshmanan <abhishek@suse.com>
Tue, 17 Jul 2018 14:20:54 +0000 (16:20 +0200)
The osd_skip_data_digest is about skipping the storing and checking of a
full-object data digest.  Here it is also disabling crc checks during
deep-scrub, which prevents us from detecting crc differences across
replicas.  Fix!

Fixes: http://tracker.ceph.com/issues/24922
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 101e88aa70ac56100a631a2da503b8b0ecb4f625)

Conflicts:
src/osd/ECBackend.cc
  drop the non existant skip_data_digest in L
  drop the non existant skip_data_digest in L

src/osd/ECBackend.cc
src/osd/ReplicatedBackend.cc

index 6c6e955e72d57dc30579b57801e24174c6a86d53..b09adc33d0c8d9bff0937ba3ea0b1954e0dbcb9d 100644 (file)
@@ -2407,8 +2407,6 @@ int ECBackend::be_deep_scrub(
 {
   dout(10) << __func__ << " " << poid << " pos " << pos << dendl;
   int r;
-  bool skip_data_digest = store->has_builtin_csum() &&
-    g_conf->osd_skip_data_digest;
 
   uint32_t fadvise_flags = CEPH_OSD_OP_FLAG_FADVISE_SEQUENTIAL |
                            CEPH_OSD_OP_FLAG_FADVISE_DONTNEED;
@@ -2449,7 +2447,7 @@ int ECBackend::be_deep_scrub(
     o.read_error = true;
     return 0;
   }
-  if (r > 0 && !skip_data_digest) {
+  if (r > 0) {
     pos.data_hash << bl;
   }
   pos.data_pos += r;
@@ -2475,8 +2473,7 @@ int ECBackend::be_deep_scrub(
        return 0;
       }
 
-      if (!skip_data_digest &&
-          hinfo->get_chunk_hash(get_parent()->whoami_shard().shard) !=
+      if (hinfo->get_chunk_hash(get_parent()->whoami_shard().shard) !=
          pos.data_hash.digest()) {
        dout(0) << "_scan_list  " << poid << " got incorrect hash on read 0x"
                << std::hex << pos.data_hash.digest() << " !=  expected 0x"
index d5be66694233e7cd47730801e4ee4548397c5cb7..295b9a97207c555f0a515fbed6b70377060ddd11 100644 (file)
@@ -599,9 +599,6 @@ int ReplicatedBackend::be_deep_scrub(
   uint32_t fadvise_flags = CEPH_OSD_OP_FLAG_FADVISE_SEQUENTIAL |
                            CEPH_OSD_OP_FLAG_FADVISE_DONTNEED;
 
-  bool skip_data_digest = store->has_builtin_csum() &&
-    g_conf->osd_skip_data_digest;
-
   utime_t sleeptime;
   sleeptime.set_from_double(cct->_conf->osd_debug_deep_scrub_sleep);
   if (sleeptime != utime_t()) {
@@ -629,7 +626,7 @@ int ReplicatedBackend::be_deep_scrub(
       o.read_error = true;
       return 0;
     }
-    if (r > 0 && !skip_data_digest) {
+    if (r > 0) {
       pos.data_hash << bl;
     }
     pos.data_pos += r;
@@ -640,10 +637,8 @@ int ReplicatedBackend::be_deep_scrub(
     }
     // done with bytes
     pos.data_pos = -1;
-    if (!skip_data_digest) {
-      o.digest = pos.data_hash.digest();
-      o.digest_present = true;
-    }
+    o.digest = pos.data_hash.digest();
+    o.digest_present = true;
     dout(20) << __func__ << "  " << poid << " done with data, digest 0x"
             << std::hex << o.digest << std::dec << dendl;
   }