]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: check the connection first in fulfill_log 12579/head
authorhuangjun <hjwsm1989@gmail.com>
Tue, 20 Dec 2016 05:31:59 +0000 (13:31 +0800)
committerhuangjun <hjwsm1989@gmail.com>
Tue, 20 Dec 2016 05:31:59 +0000 (13:31 +0800)
          No need to prepare reply message if the connection not exist

Signed-off-by: huangjun <hjwsm1989@gmail.com>
src/osd/PG.cc

index 312d12b685fdb448eac5176f84bed0d338358992..1cba004bbe2a8094110e273f1de056c4f6c9a778 100644 (file)
@@ -4815,6 +4815,9 @@ void PG::fulfill_log(
   dout(10) << "log request from " << from << dendl;
   assert(from == primary);
   assert(query.type != pg_query_t::INFO);
+  ConnectionRef con = osd->get_con_osd_cluster(
+    from.osd, get_osdmap()->get_epoch());
+  if (!con) return;
 
   MOSDPGLog *mlog = new MOSDPGLog(
     from.shard, pg_whoami.shard,
@@ -4841,14 +4844,8 @@ void PG::fulfill_log(
 
   dout(10) << " sending " << mlog->log << " " << mlog->missing << dendl;
 
-  ConnectionRef con = osd->get_con_osd_cluster(
-    from.osd, get_osdmap()->get_epoch());
-  if (con) {
-    osd->share_map_peer(from.osd, con.get(), get_osdmap());
-    osd->send_message_osd_cluster(mlog, con.get());
-  } else {
-    mlog->put();
-  }
+  osd->share_map_peer(from.osd, con.get(), get_osdmap());
+  osd->send_message_osd_cluster(mlog, con.get());
 }