From f7d7824abca0f42a6a9b45117929cfbba20b2247 Mon Sep 17 00:00:00 2001 From: huangjun Date: Tue, 20 Dec 2016 13:31:59 +0800 Subject: [PATCH] osd/PG: check the connection first in fulfill_log No need to prepare reply message if the connection not exist Signed-off-by: huangjun --- src/osd/PG.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 312d12b685f..1cba004bbe2 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()); }