From 3fac3b1236c4918e9640e38fe7f5f59efc0a23b9 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Mon, 10 Feb 2020 19:20:08 -0800 Subject: [PATCH] mon/MDSMonitor: enforce mds_join_fs cluster affinity Before this, "mds_join_fs" config enforced a preference for the standby the monitors would select. Now the monitors actively enforce this by purposefully removing an MDS wither lower "affinity". An MDS standby has highest affinity if its mds_join_fs is the file system in question or a vanilla standby (no mds_join_fs). Fixes: https://tracker.ceph.com/issues/43392 Signed-off-by: Patrick Donnelly --- PendingReleaseNotes | 5 +- src/common/options.cc | 5 +- src/mds/FSMap.cc | 88 ++++----- src/mds/FSMap.h | 43 ++--- src/mds/MDSMap.cc | 9 +- src/mds/MDSMap.h | 1 + src/mon/FSCommands.cc | 10 +- src/mon/MDSMonitor.cc | 432 ++++++++++++++++++++++++------------------ src/mon/MDSMonitor.h | 8 +- 9 files changed, 322 insertions(+), 279 deletions(-) diff --git a/PendingReleaseNotes b/PendingReleaseNotes index a6237e45d36..52175c25c20 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -293,7 +293,10 @@ the racks. In those cases, the configuration value can be increased. * MDS daemons can now be assigned to manage a particular file system via the - new ``mds_join_fs`` option. + new ``mds_join_fs`` option. The monitors will try to use only MDS for a file + system with mds_join_fs equal to the file system name (strong affinity). + Monitors may also deliberately failover an active MDS to a standby when the + cluster is otherwise healthy if the standby has stronger affinity. * RGW Multisite: A new fine grained bucket-granularity policy configuration system has been introduced and it supersedes the previous coarse zone sync diff --git a/src/common/options.cc b/src/common/options.cc index 708e86aeebe..05e901fc84b 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -7566,9 +7566,10 @@ std::vector