summaryrefslogtreecommitdiffstats
path: root/src/mgr/MgrClient.h
diff options
context:
space:
mode:
authorSage Weil <sage@redhat.com>2019-09-27 23:01:44 +0200
committerSage Weil <sage@redhat.com>2019-10-04 16:07:03 +0200
commit6f35d2835268eade059535b62378d6d407ef9e87 (patch)
treefdd2b6c803cef5038d9f290fb679339a27e56aa9 /src/mgr/MgrClient.h
parentqa/workunits/cephtool: fix errpr checks for 'ceph daemon' commands (diff)
downloadceph-6f35d2835268eade059535b62378d6d407ef9e87.tar.xz
ceph-6f35d2835268eade059535b62378d6d407ef9e87.zip
mgr,mgr/MgrClient: use fsid to signal mon-mgr vs cli MCommands
We can't use the feature bit for the MCommand connection to tell whether it is a tell or CLI command because new clients may have to send CLI commands via MCommand for old clusters, and they don't always know whether this mgr is new or old yet. Prior to octopus, MCommand contained a mon/mgr CLI command, and did not have the fsid field set. Start populating the fsid field, and use this to signal whether a client is a new MgrClient that knows MCommand vs MMgrCommand. If we get an MCommand with the fsid set, that means it is a tell command; otherwise, it's an old client sending a CLI command. Signed-off-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'src/mgr/MgrClient.h')
-rw-r--r--src/mgr/MgrClient.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mgr/MgrClient.h b/src/mgr/MgrClient.h
index 9d5251d9d20..7e5272dbedb 100644
--- a/src/mgr/MgrClient.h
+++ b/src/mgr/MgrClient.h
@@ -32,6 +32,7 @@ class MMgrClose;
class Messenger;
class MCommandReply;
class MPGStats;
+class MonMap;
class MgrSessionState
{
@@ -59,6 +60,7 @@ protected:
CephContext *cct;
MgrMap map;
Messenger *msgr;
+ MonMap *monmap;
std::unique_ptr<MgrSessionState> session;
@@ -105,7 +107,7 @@ protected:
bool mgr_optional = false;
public:
- MgrClient(CephContext *cct_, Messenger *msgr_);
+ MgrClient(CephContext *cct_, Messenger *msgr_, MonMap *monmap);
void set_messenger(Messenger *msgr_) { msgr = msgr_; }