Monitors need to talk to each other, which causes the inaccurate
mon-num counting logic of 'ceph features' command.
E.g.:
(1) By specifying 2 monitors, you get 4 from 'ceph features':
"mon": {
"group": {
"features":
2305244844532236283,
"release": "luminous",
"num": 4
}
},
(2) By specifying 3 monitors, you get 9 from 'ceph features':
"mon": {
"group": {
"features":
2305244844532236283,
"release": "luminous",
"num": 9
}
},
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
mgr_messenger->add_dispatcher_tail(this); // for auth ms_* calls
bootstrap();
+ // add features of myself into feature_map
+ session_map.feature_map.add_mon(con_self->get_features());
return 0;
}
std::map<uint32_t,std::map<uint64_t,uint64_t>> m;
void add(uint32_t type, uint64_t features) {
+ if (type == CEPH_ENTITY_TYPE_MON) {
+ return;
+ }
m[type][features]++;
}
+ void add_mon(uint64_t features) {
+ m[CEPH_ENTITY_TYPE_MON][features]++;
+ }
+
void rm(uint32_t type, uint64_t features) {
+ if (type == CEPH_ENTITY_TYPE_MON) {
+ return;
+ }
auto p = m.find(type);
assert(p != m.end());
auto q = p->second.find(features);