Skip to content

Commit

Permalink
Merge pull request #8187 from liewegas/wip-15171
Browse files Browse the repository at this point in the history
hammer: osd/ReplicatedPG: do not proxy read *and* process op locally

Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: David Zafman <dzafman@redhat.com>
Reviewed-by: David Disseldorp <ddiss@suse.de>
  • Loading branch information
Loic Dachary committed Mar 31, 2016
2 parents 0418943 + 7eae05e commit 7cfc739
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/osd/ReplicatedPG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1805,6 +1805,7 @@ bool ReplicatedPG::maybe_handle_cache(OpRequestRef op,
bool can_proxy_read = get_osdmap()->get_up_osd_features() &
CEPH_FEATURE_OSD_PROXY_FEATURES;
OpRequestRef promote_op;
bool did_proxy_read = false;

switch (pool.info.cache_mode) {
case pg_pool_t::CACHEMODE_WRITEBACK:
Expand Down Expand Up @@ -1832,10 +1833,12 @@ bool ReplicatedPG::maybe_handle_cache(OpRequestRef op,
return true;
}

if (can_proxy_read)
if (can_proxy_read) {
do_proxy_read(op);
else
did_proxy_read = true;
} else {
promote_op = op; // for non-proxy case promote_object needs this
}

// Avoid duplicate promotion
if (obc.get() && obc->is_blocked()) {
Expand Down Expand Up @@ -1877,7 +1880,7 @@ bool ReplicatedPG::maybe_handle_cache(OpRequestRef op,
promote_object(obc, missing_oid, oloc, promote_op);
} else {
// not promoting
return false;
return did_proxy_read;
}
break;
}
Expand Down

0 comments on commit 7cfc739

Please sign in to comment.