]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG::do_update_log_missing: take the pg lock in the callback 11754/head
authorSamuel Just <sjust@redhat.com>
Thu, 3 Nov 2016 00:38:49 +0000 (17:38 -0700)
committerSamuel Just <sjust@redhat.com>
Thu, 3 Nov 2016 00:40:43 +0000 (17:40 -0700)
Fixes: http://tracker.ceph.com/issues/17789
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/ReplicatedPG.cc

index 5bbd4a47e5425424637ea2c02ebe576c7387da81..2ec800014692078f62151806c3d14b82e02d2b59 100644 (file)
@@ -9894,13 +9894,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),
@@ -9909,7 +9909,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 */