Enhancement #75892
closedmds/FSMap: prefer standby-replay daemons on separate host (IP)
100%
Description
Right now the logic for FSMap::get_available_standby doesn't account for the current rank's node. During upgrades, restarting a node may take down both the active rank and its standby-replay daemon. So, change FSMap::get_available_standby to prefer an MDS on another node (when called by FSMap::find_replacement_for).
PD Updated by Patrick Donnelly 8 months ago
- Tracker changed from Bug to Enhancement
- Category set to Administration/Usability
- Target version set to v21.0.0
- Backport set to tentacle,squid
- Regression deleted (
No) - Severity deleted (
3 - minor)
VS Updated by Venky Shankar 8 months ago
- Assignee set to Jos Collin
- Source set to Development
RS Updated by Robert Sander 7 months ago
I would like to add my thoughts from https://lists.ceph.io/hyperkitty/list/[email protected]/thread/6TGPKDTH5TMQD4VJK27WEQNYYZTT4DAR/
A standby-replay MDS should not be in the same failure domain (which may be larger than just host) as the active MDS for the same rank.
PD Updated by Patrick Donnelly 7 months ago
Robert Sander wrote in #note-3:
I would like to add my thoughts from https://lists.ceph.io/hyperkitty/list/[email protected]/thread/6TGPKDTH5TMQD4VJK27WEQNYYZTT4DAR/
A standby-replay MDS should not be in the same failure domain (which may be larger than just host) as the active MDS for the same rank.
Robert Sander wrote in #note-3:
I would like to add my thoughts from https://lists.ceph.io/hyperkitty/list/[email protected]/thread/6TGPKDTH5TMQD4VJK27WEQNYYZTT4DAR/
A standby-replay MDS should not be in the same failure domain (which may be larger than just host) as the active MDS for the same rank.
If you lose an entire rack (for instance), the file system will likely become mostly unavailable during that time as MDS come back online. Trying to put all MDS on the same rack to optimize failover to another rack may only multiply your problems as all MDS failover simultaneously (consider distributed cache state re-establishment).
The design of standby-replay and its configs was deliberately simplified to avoid introducing this kind of complex failover management, as it behaves very differently than OSD failover.
That said, it is useful to make it so a same-node failover doesn't also bring down the poorly placed standby-replay daemon. It also makes sense not to put two actives on the same node when avoidable.
RS Updated by Robert Sander 7 months ago
Patrick Donnelly wrote in #note-4:
If you lose an entire rack (for instance), the file system will likely become mostly unavailable during that time as MDS come back online. Trying to put all MDS on the same rack to optimize failover to another rack may only multiply your problems as all MDS failover simultaneously (consider distributed cache state re-establishment).
You must have misunderstood me. I do not want to have the active and standby-replay MDS in the same failure zone (e.g. rack).
Currently this happens as the standby-replay is chosen randomly from all available standby MDSs.
I made a little Python script to check if both are in the same failure zone and then fail the standby-replay to get one from another rack: https://github.com/HeinleinSupport/ceph-heinlein-tools/blob/master/mds_failure_domain/mds_failure_domain.py
JC Updated by Jos Collin 5 months ago
- Status changed from New to Fix Under Review
- Pull request ID set to 69801
VS Updated by Venky Shankar 5 months ago
- Backport changed from tentacle,squid to tentacle,squid,umbrella
- Component(FS) MDS added
VS Updated by Venky Shankar 5 months ago
- Target version changed from v21.0.0 to v22.0.0
VS Updated by Venky Shankar 3 months ago
- Backport deleted (
tentacle,squid,umbrella)
I don't think this is a backport candidate. Upstream PR has been merged.
UB Updated by Upkeep Bot 3 months ago
- Status changed from Fix Under Review to Resolved
- Merge Commit set to 04d5c81a1732fda9c820f4da676c6d097140fd91
- Fixed In set to v21.3.0-2789-g04d5c81a17
- Upkeep Timestamp set to 2026-09-01T13:12:01+00:00
AD Updated by Anthony D'Atri about 1 month ago
- Status changed from Resolved to Pending Backport
- Backport set to umbrella,tentacle
Requesting umbrella and tentacle backports. On large multi-rank filesystems with several active MDS daemons per host, a host failure takes out every rank on that host at once; we lost seven active ranks to one host OOM. Promoting replacements onto a different host keeps one bad host from also taking the standbys. Encoding: main moved MDSMap ev from 19 to 20 for standby_enable_host_anti_affinity alone, and tentacle and umbrella are both at ev 19 with the same trailing fields, so both backports can carry the field at the same ev as main.
UB Updated by Upkeep Bot about 1 month ago
- Copied to Backport #82050: tentacle: mds/FSMap: prefer standby-replay daemons on separate host (IP) added
UB Updated by Upkeep Bot about 1 month ago
- Copied to Backport #82051: umbrella: mds/FSMap: prefer standby-replay daemons on separate host (IP) added
UB Updated by Upkeep Bot about 1 month ago
- Status changed from Pending Backport to Backporting
- Upkeep Timestamp changed from 2026-09-01T13:12:01+00:00 to 2026-10-23T18:33:47+00:00
JC Updated by Jos Collin about 1 month ago
Anthony D'Atri wrote in #note-11:
Requesting umbrella and tentacle backports. On large multi-rank filesystems with several active MDS daemons per host, a host failure takes out every rank on that host at once; we lost seven active ranks to one host OOM. Promoting replacements onto a different host keeps one bad host from also taking the standbys. Encoding: main moved MDSMap ev from 19 to 20 for standby_enable_host_anti_affinity alone, and tentacle and umbrella are both at ev 19 with the same trailing fields, so both backports can carry the field at the same ev as main.
@Venky Shankar Please provide your ack on these backports ?
VS Updated by Venky Shankar about 1 month ago
Jos Collin wrote in #note-15:
Anthony D'Atri wrote in #note-11:
Requesting umbrella and tentacle backports. On large multi-rank filesystems with several active MDS daemons per host, a host failure takes out every rank on that host at once; we lost seven active ranks to one host OOM. Promoting replacements onto a different host keeps one bad host from also taking the standbys. Encoding: main moved MDSMap ev from 19 to 20 for standby_enable_host_anti_affinity alone, and tentacle and umbrella are both at ev 19 with the same trailing fields, so both backports can carry the field at the same ev as main.
@Venky Shankar Please provide your ack on these backports ?
Changing standby-replay selection behaviour mid-point-release cycles (in backports) isn't a good idea in my opinion. I understand that the encoding/decoding changes do not conflict when back porting to tentacle/umbrella, but the behaviour change is something that I do not want to surprise our users with.
JC Updated by Jos Collin about 1 month ago · Edited
Venky Shankar wrote in #note-16:
Jos Collin wrote in #note-15:
Anthony D'Atri wrote in #note-11:
Requesting umbrella and tentacle backports. On large multi-rank filesystems with several active MDS daemons per host, a host failure takes out every rank on that host at once; we lost seven active ranks to one host OOM. Promoting replacements onto a different host keeps one bad host from also taking the standbys. Encoding: main moved MDSMap ev from 19 to 20 for standby_enable_host_anti_affinity alone, and tentacle and umbrella are both at ev 19 with the same trailing fields, so both backports can carry the field at the same ev as main.
@Venky Shankar Please provide your ack on these backports ?
Changing standby-replay selection behaviour mid-point-release cycles (in backports) isn't a good idea in my opinion. I understand that the encoding/decoding changes do not conflict when back porting to tentacle/umbrella, but the behaviour change is something that I do not want to surprise our users with.
@Venky Shankar I completely understand your concern about avoiding mid-release behaviour changes.
We could set "standby_enable_host_anti_affinity = false" by default for the umbrella and tentacle branches and let the user opt-in [1] and could protect themselves from that massive OOM failure scenario.
[1] ceph fs set <fs_name> standby_enable_host_anti_affinity true
But then what about the cherry-picks from umbrella and tentacle to downstream versions ? We need to edit the default behaviour by hand there too.
JC Updated by Jos Collin about 1 month ago
- % Done changed from 0 to 100
AD Updated by Anthony D'Atri about 1 month ago
Thanks, Venky, that's fair. Looking at it again, our case doesn't need it: none of our filesystems use standby-replay, and in our host failure the failed host's own standbys couldn't have been picked anyway. What hurt us there was how many active ranks sat on that one host, not where the replacements landed.
Let's keep this in main only. We withdraw the umbrella and tentacle backport request. Jos, please feel free to reject #82050 and #82051.
AD Updated by Anthony D'Atri about 1 month ago · Edited
Correction to my last note. Going back through our rank history, we have hit the same-host case. On 10-01 a futures rank stalled on one host, and the monitors promoted a standby on that same host, where it died in rejoin with std::bad_alloc at 273 GiB. The next promotion put the original daemon back on that host again. When standbys with room are available on other hosts, anti-affinity sends the replacement to one of them instead of back to the host that just failed.
So Jos's proposal works for us: backport with standby_enable_host_anti_affinity off by default on umbrella and tentacle, and we would turn it on. Venky, would that address your concern? Jos, sorry for the back and forth on #82050 and #82051.
AD Updated by Anthony D'Atri about 1 month ago · Edited
Venky, more context on why tentacle matters to us. We are planning our upgrade to Tentacle now, and we won't be in a position to move to Umbrella until next year. Our largest cluster alone runs over a hundred active MDS ranks across dozens of filesystems, with scores of standbys, and we are doubling our MDS hosts. At that scale, keeping a replacement off the host that just failed has real value for us, so getting this into 20.2.6 would matter a lot.
Jos's proposal gives us what we need without a behavior change for anyone else: the flag is off by default, and only clusters that turn it on see the new selection.
AD Updated by Anthony D'Atri 28 days ago
VS Updated by Venky Shankar 28 days ago
Anthony D'Atri wrote in #note-22:
Venky, a ping on this one: would Jos's default-off backport (#82050 tentacle, #82051 umbrella) address your concern? We're planning our Tentacle upgrade now.
Apologies for the late reply, Anthony.
OK. I am fine with backporting this given that we can flip the default to disable the new behaviour by default. @Jos Collin - not sure how much cycles you have for backporting this change. But if not, then Anthony, could you help us port this to the specific release please?
AD Updated by Anthony D'Atri 28 days ago
GF Updated by Greg Farnum 28 days ago
Venky Shankar wrote in #note-23:
Anthony D'Atri wrote in #note-22:
Venky, a ping on this one: would Jos's default-off backport (#82050 tentacle, #82051 umbrella) address your concern? We're planning our Tentacle upgrade now.
Apologies for the late reply, Anthony.
OK. I am fine with backporting this given that we can flip the default to disable the new behaviour by default. @Jos Collin - not sure how much cycles you have for backporting this change. But if not, then Anthony, could you help us port this to the specific release please?
We never specified any behavior for where standbys would go in the past; do we need a flag for going from "undefined" to "we are putting standbys somewhere more useful"?
JC Updated by Jos Collin 28 days ago
Greg Farnum wrote in #note-25:
Venky Shankar wrote in #note-23:
Anthony D'Atri wrote in #note-22:
Venky, a ping on this one: would Jos's default-off backport (#82050 tentacle, #82051 umbrella) address your concern? We're planning our Tentacle upgrade now.
Apologies for the late reply, Anthony.
OK. I am fine with backporting this given that we can flip the default to disable the new behaviour by default. @Jos Collin - not sure how much cycles you have for backporting this change. But if not, then Anthony, could you help us port this to the specific release please?
We never specified any behavior for where standbys would go in the past; do we need a flag for going from "undefined" to "we are putting standbys somewhere more useful"?
@Greg Farnum I completely agree with you -- it is a strict improvement over the previously undefined behaviour (of the physical placement), and ideally, it wouldn't need a flag at all. But this is how it's been implemented in main right now (where it defaults to true). Are you suggesting dropping the flag entirely? In that case, I would create a separate PR for main to drop it, provided Venky agrees , since it was his review comment that introduced the flag back then.
@Anthony D'Atri In the meantime, to keep things moving forward for your Tentacle upgrade, please feel free to take #82050 and #82051 and create backports. Let's stick to the compromise and have `standby_enable_host_anti_affinity` default to `false` on these backports. I'll review and approve them once you open the PRs.
VS Updated by Venky Shankar 28 days ago
Greg Farnum wrote in #note-25:
Venky Shankar wrote in #note-23:
Anthony D'Atri wrote in #note-22:
Venky, a ping on this one: would Jos's default-off backport (#82050 tentacle, #82051 umbrella) address your concern? We're planning our Tentacle upgrade now.
Apologies for the late reply, Anthony.
OK. I am fine with backporting this given that we can flip the default to disable the new behaviour by default. @Jos Collin - not sure how much cycles you have for backporting this change. But if not, then Anthony, could you help us port this to the specific release please?
We never specified any behavior for where standbys would go in the past; do we need a flag for going from "undefined" to "we are putting standbys somewhere more useful"?
True, but the new mechanism is not just a mere config change and involves a sizeable port. That said, I am fine with backporting this and retaining the old behaviour by default (and have users enable it to use it).