Skip to content

fix(maintenance): keep one mds per active file system rank - #974

Open
abrahamperz wants to merge 2 commits into
canonical:mainfrom
abrahamperz:abrahamperz/fix-maintenance-mds-per-filesystem
Open

abrahamperz wants to merge 2 commits into
canonical:mainfrom
abrahamperz:abrahamperz/fix-maintenance-mds-per-filesystem

Conversation

@abrahamperz

Copy link
Copy Markdown

Description

Entering maintenance mode checked that at least one MDS would remain on the other nodes. That is enough for a single file system with one active rank, but a cluster serving several CephFS file systems, or a file system with max_mds above one, needs an MDS for every active rank. With the old check, putting a node into maintenance could leave a file system without an MDS to fail over to.

I changed the non-OSD service check so it reads ceph fs dump and requires the sum of max_mds across all file systems to remain available besides the node going into maintenance. The requirement never drops below one, so clusters without a file system keep the previous behaviour. If the file system map cannot be read, the check fails instead of assuming one MDS is enough. The dry-run text now says the check covers the active ranks of every file system, and I updated the maintenance mode explanation page to match.

Fixes #608

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How has this been tested?

I added unit tests in microceph/ceph/operations_test.go:

  • TestGetRequiredMdss covers no file systems, one file system, two file systems, and a file system with several active ranks.
  • TestCheckNonOsdSvcEnoughOpsFailMdsPerFilesystem refuses maintenance when two file systems would be left with a single MDS.
  • TestCheckNonOsdSvcEnoughOpsPassMdsPerFilesystem allows it when one MDS per file system remains.
  • TestCheckNonOsdSvcEnoughOpsErrorFsDump checks that a failed ceph fs dump aborts the check.

The existing CheckNonOsdSvcEnoughOps and dry-run plan tests were updated for the new ceph fs dump call and dry-run text. I ran go build ./..., go vet ./... and go test ./ceph/... on Ubuntu 24.04 with Go 1.27.2, and all pass. The dry-run text keeps the prefix that the robot and shell maintenance tests match on.

Contributor checklist

Please check that you have:

  • self-reviewed the code in this PR
  • added code comments, particularly in less straightforward areas
  • checked and added or updated relevant documentation
  • added or updated HTML meta descriptions for any new or modified documentation pages (see #643)
  • verified that page title and headings accurately represent page content for new or modified documentation pages
  • checked and added or updated relevant release notes
  • added tests to verify effectiveness of this change

Entering maintenance mode only required one MDS to remain on the
other nodes. A cluster serving several CephFS file systems, or a
file system with more than one active rank, needs an MDS for each
active rank, so taking down a node could leave a file system
without an MDS to fail over to.

The non-OSD service check now reads the file system map and
requires the sum of max_mds across all file systems to remain,
with a floor of one so clusters without a file system behave as
before.

Assisted-by: claude-code:claude-opus-5-5
Signed-off-by: Abraham Perez <abraham1798@gmail.com>
Update the maintenance mode explanation to say that enough MDS
services must remain for every active rank of every file system,
and add a meta description to the page.

Assisted-by: claude-code:claude-opus-5-5
Signed-off-by: Abraham Perez <abraham1798@gmail.com>
@abrahamperz
abrahamperz force-pushed the abrahamperz/fix-maintenance-mds-per-filesystem branch from 3d05933 to d335f85 Compare November 26, 2026 05:51
@abrahamperz
abrahamperz marked this pull request as ready for review November 26, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure FS (mds) availability during maintenance

1 participant