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
1a2689f8d7.

Fixes: 
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2016-02-12 07:17:26 -05:00
parent a0858a5890
commit 7dbce5bac4

View 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 {