From: Kefu Chai Date: Fri, 12 Aug 2016 11:19:51 +0000 (+0800) Subject: mon/MonClient: should update sub_sent with sub_new X-Git-Tag: v11.0.1~421^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=550814900ebca9dd89e088b9abe24f66eb5e3e6d;p=ceph.git mon/MonClient: should update sub_sent with sub_new std::map::insert() does not overwrite existing items with the same key. so we need to do this in a different way. and we will check sub_sent aftewards, so we need to keep an updated sub_sent around. Fixes: http://tracker.ceph.com/issues/17023 Signed-off-by: Kefu Chai --- diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index cad9324b661..36aeb7d4c38 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -773,7 +773,9 @@ void MonClient::_renew_subs() m->what = sub_new; _send_mon_message(m); - sub_sent.insert(sub_new.begin(), sub_new.end()); + // update sub_sent with sub_new + sub_new.insert(sub_sent.begin(), sub_sent.end()); + std::swap(sub_new, sub_sent); sub_new.clear(); } }