MDSMonitor.cc: fix mdsmap.<namespace> subscriptions

Signed-off-by: Yan, Zheng <zyan@redhat.com>
This commit is contained in:
Yan, Zheng 2016-05-25 18:33:49 +08:00
parent 20de6de8e0
commit 8f09dd15cb

View File

@ -2411,22 +2411,22 @@ void MDSMonitor::check_subs()
{
std::list<std::string> types;
// Subscriptions may be to "fsmap" (MDS and legacy clients),
// "fsmap.<namespace>", or to "fsmap" for the full state of all
// Subscriptions may be to "mdsmap" (MDS and legacy clients),
// "mdsmap.<namespace>", or to "fsmap" for the full state of all
// filesystems. Build a list of all the types we service
// subscriptions for.
types.push_back("mdsmap");
types.push_back("fsmap");
types.push_back("mdsmap");
for (const auto &i : fsmap.filesystems) {
auto fscid = i.first;
std::ostringstream oss;
oss << "fsmap." << fscid;
oss << "mdsmap." << fscid;
types.push_back(oss.str());
}
for (const auto &type : types) {
if (mon->session_map.subs.count(type) == 0)
return;
continue;
xlist<Subscription*>::iterator p = mon->session_map.subs[type]->begin();
while (!p.end()) {
Subscription *sub = *p;