This is for use when talking to pre-luminous
clusters, where we should not block waiting
for MgrMap because it might never come.
Fixes: https://tracker.ceph.com/issues/23627
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit
bae47183c2621577ba564d29c82a0517ab8a7f54)
ldout(cct, 20) << "cmd: " << cmd << dendl;
- if (map.epoch == 0) {
+ if (map.epoch == 0 && mgr_optional) {
ldout(cct,20) << " no MgrMap, assuming EACCES" << dendl;
return -EACCES;
}
// Leaving fsid argument null because it isn't used.
MCommand *m = op.get_message({});
session->con->send_message(m);
+ } else {
+ ldout(cct, 4) << "start_command: no mgr session, waiting" << dendl;
}
return 0;
}
void reconnect();
void _send_open();
+ // In pre-luminous clusters, the ceph-mgr service is absent or optional,
+ // so we must not block in start_command waiting for it.
+ bool mgr_optional = false;
+
public:
MgrClient(CephContext *cct_, Messenger *msgr_);
void init();
void shutdown();
+ void set_mgr_optional(bool optional_) {mgr_optional = optional_;}
+
bool ms_dispatch(Message *m) override;
bool ms_handle_reset(Connection *con) override;
void ms_handle_remote_reset(Connection *con) override {}