]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: respect must_promote in WRITEBACK cache mode 7617/head
authorSage Weil <sage@redhat.com>
Fri, 12 Feb 2016 12:17:26 +0000 (07:17 -0500)
committerSage Weil <sage@redhat.com>
Fri, 12 Feb 2016 12:17:40 +0000 (07:17 -0500)
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 <sage@redhat.com>
src/osd/ReplicatedPG.cc

index 2de4b8308a79084ad27b9c21d03735fa93ab2f32..c355d603fd5fcf10fed4b89969d1934213bcd889 100644 (file)
@@ -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 {