From 7c6990d9164d8a5e423356f763fb911c2c03cfc1 Mon Sep 17 00:00:00 2001 From: John Spray Date: Wed, 21 Jun 2017 07:21:42 -0400 Subject: [PATCH] client: check for luminous MDS before sending FLUSH_MDLOG This is needed to make it safe to run newer clients on pre-luminous MDS. Signed-off-by: John Spray --- src/client/Client.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 15019d11e13b..c5813ed88e5a 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -5812,8 +5812,13 @@ void Client::flush_mdlog_sync() void Client::flush_mdlog(MetaSession *session) { - MClientSession *m = new MClientSession(CEPH_SESSION_REQUEST_FLUSH_MDLOG); - session->con->send_message(m); + // Only send this to Luminous or newer MDS daemons, older daemons + // will crash if they see an unknown CEPH_SESSION_* value in this msg. + const uint64_t features = session->con->get_features(); + if (HAVE_FEATURE(features, SERVER_LUMINOUS)) { + MClientSession *m = new MClientSession(CEPH_SESSION_REQUEST_FLUSH_MDLOG); + session->con->send_message(m); + } } -- 2.47.3