]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: check for luminous MDS before sending FLUSH_MDLOG 15805/head
authorJohn Spray <john.spray@redhat.com>
Wed, 21 Jun 2017 11:21:42 +0000 (07:21 -0400)
committerJohn Spray <john.spray@redhat.com>
Wed, 21 Jun 2017 11:22:58 +0000 (07:22 -0400)
This is needed to make it safe to run newer clients
on pre-luminous MDS.

Signed-off-by: John Spray <john.spray@redhat.com>
src/client/Client.cc

index 15019d11e13b44624ae2d9da644fc68723ff6766..c5813ed88e5ac8e4a16a31ca43e4a7ce2c028258 100644 (file)
@@ -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);
+  }
 }