From c579e051f2b3677c9a1918713f693105cf6a33de Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 14 Jul 2018 11:45:12 -0500 Subject: [PATCH] osd: do not skip_data_digests during scrub The goal was to skip storing per-object digests. Scrub still needs to calculate these digests in order to do a deep scrub, however! This is not a cherry-pick of master because the code has changed a bit and because the master fix is not merged yet. Fixes: http://tracker.ceph.com/issues/24922 Signed-off-by: Sage Weil --- src/osd/ECBackend.cc | 7 ++----- src/osd/ReplicatedBackend.cc | 11 +++-------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index 41355031436c8..23e5a50f0166c 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -2426,8 +2426,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; @@ -2468,7 +2466,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; @@ -2494,8 +2492,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" diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index acfb2a63d56d3..602a0f08f76b1 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -714,9 +714,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()) { @@ -744,7 +741,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; @@ -755,10 +752,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; } -- 2.39.5