From: Samuel Just Date: Thu, 3 Nov 2016 00:38:49 +0000 (-0700) Subject: ReplicatedPG::do_update_log_missing: take the pg lock in the callback X-Git-Tag: v10.2.6~30^2~6^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11997%2Fhead;p=ceph.git ReplicatedPG::do_update_log_missing: take the pg lock in the callback Fixes: http://tracker.ceph.com/issues/17789 Signed-off-by: Samuel Just (cherry picked from commit 3ba2e2e21a187474d556722d1ef30c79628f1c50) --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 4b879d94057a..dcc9860bc8c7 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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( - op->get_req()); + [=](int) { + MOSDPGUpdateLogMissing *msg = static_cast( + op->get_req()); + lock(); + if (!pg_has_reset_since(msg->get_epoch())) { MOSDPGUpdateLogMissingReply *reply = new MOSDPGUpdateLogMissingReply( spg_t(info.pgid.pgid, primary_shard().shard), @@ -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 */