Skip to content

Commit

Permalink
Merge pull request #11754 from athanatos/wip-17789
Browse files Browse the repository at this point in the history
osd/ReplicatedPG: do_update_log_missing: take the pg lock in the callback

Reviewed-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
liewegas committed Nov 7, 2016
2 parents f80c7a8 + 3ba2e2e commit 27efa84
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/osd/ReplicatedPG.cc
Expand Up @@ -9897,13 +9897,13 @@ void ReplicatedPG::do_update_log_missing(OpRequestRef &op)
assert(m->get_type() == MSG_OSD_PG_UPDATE_LOG_MISSING);
ObjectStore::Transaction t;
append_log_entries_update_missing(m->entries, t);
// TODO FIX

Context *complete = new FunctionContext(
[=](int) {
MOSDPGUpdateLogMissing *msg =
static_cast<MOSDPGUpdateLogMissing*>(
op->get_req());
[=](int) {
MOSDPGUpdateLogMissing *msg = static_cast<MOSDPGUpdateLogMissing*>(
op->get_req());
lock();
if (!pg_has_reset_since(msg->get_epoch())) {
MOSDPGUpdateLogMissingReply *reply =
new MOSDPGUpdateLogMissingReply(
spg_t(info.pgid.pgid, primary_shard().shard),
Expand All @@ -9912,7 +9912,9 @@ void ReplicatedPG::do_update_log_missing(OpRequestRef &op)
msg->get_tid());
reply->set_priority(CEPH_MSG_PRIO_HIGH);
msg->get_connection()->send_message(reply);
});
}
unlock();
});

/* Hack to work around the fact that ReplicatedBackend sends
* ack+commit if commit happens first */
Expand Down

0 comments on commit 27efa84

Please sign in to comment.