CompatSet features;
- const MonCommand *leader_supported_mon_commands;
- int leader_supported_mon_commands_size;
+ vector<MonCommand> leader_mon_commands; // quorum leader's commands
+ vector<MonCommand> local_mon_commands; // commands i support
+ bufferlist local_mon_commands_bl; // encoded version of above
+
+ // for upgrading mon cluster that still uses PGMonitor
+ vector<MonCommand> local_upgrading_mon_commands; // mixed mon cluster commands
+ bufferlist local_upgrading_mon_commands_bl; // encoded version of above
Messenger *mgr_messenger;
MgrClient mgr_client;
* Intersection of quorum members mon-specific feature bits
*/
mon_feature_t quorum_mon_features;
- bufferlist supported_commands_bl; // encoded MonCommands we support
set<string> outside_quorum;
void win_election(epoch_t epoch, set<int>& q,
uint64_t features,
const mon_feature_t& mon_features,
- const map<int,Metadata>& metadata,
- const MonCommand *cmdset, int cmdsize);
+ const map<int,Metadata>& metadata);
void lose_election(epoch_t epoch, set<int>& q, int l,
uint64_t features,
const mon_feature_t& mon_features);
// end election (called by Elector)
void finish_election();
- const bufferlist& get_supported_commands_bl() {
- return supported_commands_bl;
- }
-
void update_logger();
/**
map<string,string> ¶m_str_map);
static const MonCommand *_get_moncommand(
const string &cmd_prefix,
- const MonCommand *cmds,
- int cmds_size);
+ const vector<MonCommand>& cmds);
bool _allowed_command(MonSession *s, string &module, string &prefix,
const map<string,cmd_vartype>& cmdmap,
const map<string,string>& param_str_map,
Formatter *f,
bufferlist *rdata,
bool hide_mgr_flag=false);
- void get_locally_supported_monitor_commands(const MonCommand **cmds, int *count);
- /// the Monitor owns this pointer once you pass it in
- void set_leader_supported_commands(const MonCommand *cmds, int size);
+
+ const std::vector<MonCommand> &get_local_commands(mon_feature_t f) {
+ if (f.contains_all(ceph::features::mon::FEATURE_LUMINOUS))
+ return local_mon_commands;
+ else
+ return local_upgrading_mon_commands;
+ }
+ const bufferlist& get_local_commands_bl(mon_feature_t f) {
+ if (f.contains_all(ceph::features::mon::FEATURE_LUMINOUS))
+ return local_mon_commands_bl;
+ else
+ return local_upgrading_mon_commands_bl;
+ }
+ void set_leader_commands(const std::vector<MonCommand>& cmds) {
+ leader_mon_commands = cmds;
+ }
+
static bool is_keyring_required();
};