Skip to content

Commit

Permalink
ReplicatedPG::do_update_log_missing: take the pg lock in the callback
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/17789
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 3ba2e2e)
  • Loading branch information
athanatos authored and Abhishek Varshney committed Nov 15, 2016
1 parent 6cf2916 commit ff2e194
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/osd/ReplicatedPG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9685,13 +9685,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 @@ -9700,7 +9700,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 ff2e194

Please sign in to comment.