From 9e2c4fa4c8e255ffbca82c594d1ec4f099b908b8 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Wed, 30 May 2018 17:18:03 -0700 Subject: [PATCH] osd: Handle omap and data digests independently 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 (cherry picked from commit 01f9669928abd571e14421a51a749d44fa041337) --- src/osd/PGBackend.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index ecc404c6f7842..7c508adf396d5 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -1059,9 +1059,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; } @@ -1091,13 +1094,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 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 { -- 2.39.5