From 7dbce5bac4945faad761408d5a28adcd5862374c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 12 Feb 2016 07:17:26 -0500 Subject: [PATCH] osd/ReplicatedPG: respect must_promote in WRITEBACK cache mode Force a promotion of the op requires it. This bug was easily masked because the defaultish cache parameters would often promote anyway (e.g., if min read recency was 0). This was broken during the refactor in 1a2689f8d74537b105cdcf2933f080a2bee9f190. Fixes: #14745 Signed-off-by: Sage Weil --- src/osd/ReplicatedPG.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 2de4b8308a79..c355d603fd5f 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -2147,11 +2147,13 @@ ReplicatedPG::cache_result_t ReplicatedPG::maybe_handle_cache_detail( return cache_result_t::BLOCKED_FULL; } - if (!hit_set && (must_promote || !op->need_skip_promote())) { + if (must_promote || (!hit_set && !op->need_skip_promote())) { promote_object(obc, missing_oid, oloc, op, promote_obc); return cache_result_t::BLOCKED_PROMOTE; - } else if (op->may_write() || op->may_cache()) { - if (can_proxy_write && !must_promote) { + } + + if (op->may_write() || op->may_cache()) { + if (can_proxy_write) { do_proxy_write(op, missing_oid); } else { // promote if can't proxy the write @@ -2169,7 +2171,7 @@ ReplicatedPG::cache_result_t ReplicatedPG::maybe_handle_cache_detail( return cache_result_t::HANDLED_PROXY; } else { bool did_proxy_read = false; - if (can_proxy_read && !must_promote) { + if (can_proxy_read) { do_proxy_read(op); did_proxy_read = true; } else { -- 2.47.3