From: huangjun Date: Tue, 20 Dec 2016 05:31:59 +0000 (+0800) Subject: osd/PG: check the connection first in fulfill_log X-Git-Tag: v12.0.0~398^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f7d7824abca0f42a6a9b45117929cfbba20b2247;p=ceph.git osd/PG: check the connection first in fulfill_log No need to prepare reply message if the connection not exist Signed-off-by: huangjun --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 312d12b685fd..1cba004bbe2a 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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()); }