Skip to content

Protect against down-level OSDs joining the cluster after upgrade - #68773

Merged
aainscow merged 4 commits into
ceph:mainfrom
JonBailey1993:downlevel-osd-protection
Nov 13, 2026
Merged

aainscow merged 4 commits into
ceph:mainfrom
JonBailey1993:downlevel-osd-protection

Conversation

@JonBailey1993

Copy link
Copy Markdown
Contributor

Currently it is still possible for a downlevel OSD to join the cluster, as explained in https://tracker.ceph.com/issues/75563. This commit adds protections to prevent this being possible. by making it so that downlevel OSDs get rejected from the cluster after you raise the require-osd-release flag.

This is necissairy as some features use this flag as a gate to decide on whether to enable new features of not. If a feature changes metadata assuming all OSDs are at the required level, its possible to add a new downlevel after this fact and cause corruption as the downlevel OSD won't be able to understand the new feature.

The flag cannot be switched until all OSDs are uplevel, but once its switched it doesn't protect against new downlevel OSDs are added. This adds in the missing piece of protection.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@JonBailey1993
JonBailey1993 requested a review from a team as a code owner May 6, 2026 13:32
@JonBailey1993

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@ljflores ljflores left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JonBailey1993 how can we best verify this fix?

I see you listed some manual steps in the tracker ticket, but I'm curious if we need to add an additional test to verify (i.e. in teuthology or in unit tests).

Comment thread src/mon/OSDMonitor.cc Outdated
goto ignore;
}

// We should not allow booting of pre-umbrella OSDs once you have set require_osd_release

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I agree. However, there is a missed piece – the release-checklist must be extended.

@JonBailey1993 JonBailey1993 May 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did take a look at the release checklist when I made the PR. The lines above seem to come under the heading
- [x] search code for X-2 and X-3 (`CEPH_FEATURE_SERVER_*` and `ceph_release_t::*`)
which sounded like it applied to this as well, so I assumed an update to the checklist wasn't needed. If we want to explicitly call out modifying this exact function with these checks though, I can add something in. What do you think @rzarzynski ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer something more specific to the this file and method.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing then, I will add a commit for the release checklist to this PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should now be added

@JonBailey1993

JonBailey1993 commented May 12, 2026 •

Copy link
Copy Markdown
Contributor Author

@JonBailey1993 how can we best verify this fix?

I see you listed some manual steps in the tracker ticket, but I'm curious if we need to add an additional test to verify (i.e. in teuthology or in unit tests).

@ljflores I included a script in the tracker ticket too I think (if I'm wrong, I still have the script locally), which is what I used to verify this before I pushed. It's not really designed for teuthology at this point in time, but I suspect it could be turned into a standalone test or something in teuthology or something potentially - I'm not really sure on the architecture of teuthology currently so I'd have to find some time to learn and understand this before I could do this.

@bill-scales bill-scales left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bill-scales

Copy link
Copy Markdown
Contributor

@JonBailey1993 how can we best verify this fix?
I see you listed some manual steps in the tracker ticket, but I'm curious if we need to add an additional test to verify (i.e. in teuthology or in unit tests).

@ljflores I included a script in the tracker ticket too I think (if I'm wrong, I still have the script locally), which is what I used to verify this before I pushed. It's not really designed for teuthology at this point in time, but I suspect it could be turned into a standalone test or something in teuthology or something potentially - I'm not really sure on the architecture of teuthology currently so I'd have to find some time to learn and understand this before I could do this.

How do we do this as a teuthology test? We need a mixture of OSDs running two different releases, but unlike the upgrade tests that use cephadm we would have to do this without cephadm because it won't let you create this scenario. So that either means we need to write a test that uses container images (like the upgrade test) but starts/stops OSD containers manually rather than using cephadm, or we need a way of get teuthology to install different RPMs on different nodes.

Are there any upgrade tests that don't use cephadm that we could look at and use as a basis for this test?

@ljflores

ljflores commented Jun 1, 2026 •

Copy link
Copy Markdown
Member

@JonBailey1993 how can we best verify this fix?
I see you listed some manual steps in the tracker ticket, but I'm curious if we need to add an additional test to verify (i.e. in teuthology or in unit tests).

@ljflores I included a script in the tracker ticket too I think (if I'm wrong, I still have the script locally), which is what I used to verify this before I pushed. It's not really designed for teuthology at this point in time, but I suspect it could be turned into a standalone test or something in teuthology or something potentially - I'm not really sure on the architecture of teuthology currently so I'd have to find some time to learn and understand this before I could do this.

How do we do this as a teuthology test? We need a mixture of OSDs running two different releases, but unlike the upgrade tests that use cephadm we would have to do this without cephadm because it won't let you create this scenario. So that either means we need to write a test that uses container images (like the upgrade test) but starts/stops OSD containers manually rather than using cephadm, or we need a way of get teuthology to install different RPMs on different nodes.

Are there any upgrade tests that don't use cephadm that we could look at and use as a basis for this test?

@bill-scales I recently went through a deep-dive of the upgrade tests to see which tests are containerized vs. bare metal. I found that the "normal stable release" upgrade tests (i.e. where the upgrade path is "tentacle --> main", "squid --> main", "squid --> tentacle") are all containerized. But the "point to point" upgrade tests (i.e. where the upgrade path is "v20.2.0 --> v20.2.1 --> tip of tentacle") are all bare metal.

It seems like for this problem, you'd need to test a "normal stable release" upgrade path on bare metal. But all of these types of tests are containerized. However, you could potentially use the point-to-point tests as a basis to create a new test.

You can see more about what we're testing in terms of upgrade paths in this doc (https://docs.google.com/document/d/1cF6Raroc_BeGBIj-LjnRzByRPqFhWVLc-LKyaVdyIzM/edit?usp=sharing) where we were checking our Rocky10 coverage. I hope this provides some better context.

@bill-scales

Copy link
Copy Markdown
Contributor

Thanks @ljflores for the pointers, that's exactly what we need

@JonBailey1993 you should be able to write a teuthology test to do this using the install.upgrade task to upgrade a single node. Here is a sketch of what the test will look like, probably full of syntax errors and there's probably stuff missing in the ceph: section to make sure the cluster is created and started, and there's no check for the osd failing to start at the end.

For more information see teuthology/task/install/init.py for more details about the install and install.upgrade tasks. I suspect you don't need to specify a tag on the install.upgrade if you just want it to pick up the latest main. See qa/tasks/ceph.py for more details about the ceph.stop and ceph.restart tasks. See also the expected-failure config setting in ceph.restart - you might be able to use this to check for the failure, although I think this is looking in the osd log file, not the mon or cluster log.

roles:
- - mon.a
  - osd.0
- - osd.1
tasks:
# Install 19.2.0 on both nodes
- install:
   tag: v19.2.0
# Start ceph cluster
- ceph:
# Upgrade one node to 20.2.0
- install.upgrade:
   mon.a:
     tag: v20.2.0
# Restart mon + osd.0 to upgrade
- ceph.restart: [mon.a]
- sleep:
    duration: 30
- ceph.restart: [osd.0]
- sleep:
    duration: 30
# Stop osd.1
- ceph.stop: [osd.1]
# Set min osd release
- exec:
      mon.a:
        - ceph osd require-osd-release tentacle
# Restart osd.1 (now below require-osd-release)
- ceph.restart: [osd.1]

@JonBailey1993
JonBailey1993 requested a review from a team as a code owner July 9, 2026 12:12
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@anthonyeleven

anthonyeleven commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

How have you seen this happen? The scenario that comes to mind is a host that's down during the upgrade and subsequently repaired and booted. In this scenario, how would one upgrade those OSDs so they could rejoin? Would the devices have to be zapped and new OSDs deployed? In the tracker I'm uncertain how "Add a new squid OSD to the cluster" would be done, other than by manually specifying a Squid container image, which I guess could happen inadvertently. Maybe this should raise a health warning so someone running into it doesn't wonder why the OSD won't come up/in?

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

How have you seen this happen?

It was artificially created through testing to check for holes in our upgrade process. In the test it was just done by launching a downlevel OSD process, none of the test was orchestrated through cephadm or anything.

Maybe this should raise a health warning so someone running into it doesn't wonder why the OSD won't come up/in?

I'd be happy to do this, I can add this.

@anthonyeleven

Copy link
Copy Markdown
Contributor

How have you seen this happen?

It was artificially created through testing to check for holes in our upgrade process. In the test it was just done by launching a downlevel OSD process, none of the test was orchestrated through cephadm or anything.

Maybe this should raise a health warning so someone running into it doesn't wonder why the OSD won't come up/in?

I'd be happy to do this, I can add this.

Awesome. I could see myself blowing a couple of frustrating hours trying to figure it out, and like to spare others that potential.

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Sep 11, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions Bot closed this Oct 11, 2026
@bill-scales

Copy link
Copy Markdown
Contributor

Still need to close this window, hopefully its very unlikely to occur in practice but if it does it then can cause serious damage to your data.

@aainscow

Copy link
Copy Markdown
Contributor

(claude response) Pushed on behalf of Alex Ainscow: rebased onto main, with your two commits unchanged, plus one commit on top, "mon/OSDMonitor: refuse the boot of OSDs older than any require_osd_release" (f8d9953). The per-release checks missed Vampire, which is now on main, and each later release would need another. This replaces them with one check keyed on require_osd_release, through ceph_release_server_feature(). unittest_features fails until a new release is added there, and the release-checklist line now says so. Feel free to squash it into yours.

@aainscow
aainscow requested a review from bill-scales November 9, 2026 17:56
aainscow pushed a commit to aainscow/ceph that referenced this pull request Nov 9, 2026
Carried from ceph#68773; drop when this is rebased onto a main that has it.

Currently it is still possible for a downlevel OSD to join the cluster, as explained in https://tracker.ceph.com/issues/75563. This commit adds protections to prevent this being possible. by making it so that downlevel OSDs get rejected from the cluster after you raise the require-osd-release flag.

This is necissairy as some features use this flag as a gate to decide on whether to enable new features of not. If a feature changes metadata assuming all OSDs are at the required level, its possible to add a new downlevel after this fact and cause corruption as the downlevel OSD won't be able to understand the new feature.

The flag cannot be switched until all OSDs are uplevel, but once its switched it doesn't protect against new downlevel OSDs are added. This adds in the missing piece of protection.

Signed-off-by: Jon Bailey <[email protected]>
aainscow pushed a commit to aainscow/ceph that referenced this pull request Nov 9, 2026
…dd pre-X level OSDs after require_osd_release is set.

Carried from ceph#68773; drop when this is rebased onto a main that has it.

Signed-off-by: Jon Bailey <[email protected]>
aainscow added a commit to aainscow/ceph that referenced this pull request Nov 9, 2026
…e_osd_release

Carried from ceph#68773; drop when this is rebased onto a main that has it.

The boot checks keyed on require_osd_release named squid, tentacle and
umbrella, so after 'ceph osd require-osd-release vampire' an Umbrella OSD
could still boot, and each later release would need another check that
its kickoff could forget. The squid and tentacle ones are already
covered by the N-2 lower bound.

Refuse an OSD that lacks the SERVER_* feature of require_osd_release,
looked up by a new ceph_release_server_feature(). unittest_features
fails while the release being built has no feature there, which the
release checklist now names instead of a per-release check.

Fixes: https://tracker.ceph.com/issues/75563
Assisted-by: Claude Code
Signed-off-by: Alex Ainscow <[email protected]>
@aainscow aainscow mentioned this pull request Nov 9, 2026
4 of 14 tasks
@aainscow aainscow removed the needs-qa label Nov 10, 2026
aainscow pushed a commit to aainscow/ceph that referenced this pull request Nov 10, 2026
Carried from ceph#68773; drop when this is rebased onto a main that has it.

Currently it is still possible for a downlevel OSD to join the cluster, as explained in https://tracker.ceph.com/issues/75563. This commit adds protections to prevent this being possible. by making it so that downlevel OSDs get rejected from the cluster after you raise the require-osd-release flag.

This is necissairy as some features use this flag as a gate to decide on whether to enable new features of not. If a feature changes metadata assuming all OSDs are at the required level, its possible to add a new downlevel after this fact and cause corruption as the downlevel OSD won't be able to understand the new feature.

The flag cannot be switched until all OSDs are uplevel, but once its switched it doesn't protect against new downlevel OSDs are added. This adds in the missing piece of protection.

Signed-off-by: Jon Bailey <[email protected]>
aainscow pushed a commit to aainscow/ceph that referenced this pull request Nov 10, 2026
…dd pre-X level OSDs after require_osd_release is set.

Carried from ceph#68773; drop when this is rebased onto a main that has it.

Signed-off-by: Jon Bailey <[email protected]>
aainscow added a commit to aainscow/ceph that referenced this pull request Nov 10, 2026
…e_osd_release

Carried from ceph#68773; drop when this is rebased onto a main that has it.

The boot checks keyed on require_osd_release named squid, tentacle and
umbrella, so after 'ceph osd require-osd-release vampire' an Umbrella OSD
could still boot, and each later release would need another check that
its kickoff could forget. The squid and tentacle ones are already
covered by the N-2 lower bound.

Refuse an OSD that lacks the SERVER_* feature of require_osd_release,
looked up by a new ceph_release_server_feature(). unittest_features
fails while the release being built has no feature there, which the
release checklist now names instead of a per-release check.

Fixes: https://tracker.ceph.com/issues/75563
Assisted-by: Claude Code
Signed-off-by: Alex Ainscow <[email protected]>
@aainscow

Copy link
Copy Markdown
Contributor

(claude response) Pushed on behalf of Alex Ainscow: one more commit, "qa/suites/rados/upgrade: test the boot of an OSD older than require_osd_release" (643fb67). It adds qa/suites/rados/upgrade/require-osd-release, a bare-metal test built from @bill-scales's install/install.upgrade sketch. It starts the cluster on umbrella, stops osd.3, upgrades the rest and sets require-osd-release vampire, then restarts osd.3 still on umbrella and checks that it stays down. Finally it upgrades osd.3's node and checks that osd.3 joins and the cluster goes healthy.

It passes with this PR: https://pulpito.ceph.com/aainscow-2026-11-10_10:37:12-rados:upgrade-wip-aainscow-osd-boot-require-release-261110-distro-default-trial/
The mon logged disallowing boot of OSD osd.3 ... because require_osd_release is vampire and the osd is of an earlier release, and osd.3 joined once upgraded.

On main without the fix, it fails at the "osd.3 stays down" check because osd.3 boots on umbrella: https://pulpito.ceph.com/aainscow-2026-11-10_08:53:03-rados:upgrade-main-distro-default-trial/

@aainscow
aainscow force-pushed the downlevel-osd-protection branch from 643fb67 to 5de14e3 Compare November 11, 2026 14:48
@aainscow
aainscow requested a review from CJamesIBM November 11, 2026 15:01
@CJamesIBM

Copy link
Copy Markdown
Contributor

LGTM but probably good to squash commits, keep the QA commit separate?

Also Anthony mentioned adding a health warn but I can't see that in this PR

Comment thread doc/dev/release-checklists.rst Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this line be updated to use same style as everything else, i.e to X?

aainscow added a commit to JonBailey1993/ceph that referenced this pull request Nov 11, 2026
The checklist step for the require-osd-release calls in the qa upgrade
suites still named tentacle, the release it was written for. Use X like
the other steps.

Answers Callum James' review comment on
ceph#68773
(ceph#68773 (comment)).

Assisted-by: Claude Code

@bill-scales bill-scales left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Although last couple of commits need squashing or signing off.

My opinion is that a health check is overkill. With a cephadm managed cluster this condition should never happen - it manages the upgrade and updates require_osd_release at the end of the upgrade. Cephadm is responsible for making sure all the OSDs get upgraded.

If you are managing a cluster yourself you need to upgrade the OSDs and then set require_osd_release at the end. You only get into difficulties if an OSD is down during the upgrade and you set require_osd_release while the OSD is missing and hasn't been upgraded and then later it returns and tries to rejoin the cluster. We hope this is a very unlikely scenario because at the moment without this PR that OSD is liable to crash and/or crash other OSDs because it will liable to send/receive messages that can't be decoded. Having an OSD that doesn't boot is better than having an OSD that crashes/crashes other OSDs.

aainscow added a commit to JonBailey1993/ceph that referenced this pull request Nov 12, 2026
The checklist step for the require-osd-release calls in the qa upgrade
suites still named tentacle, the release it was written for. Use X like
the other steps.

Answers Callum James' review comment on
ceph#68773
(ceph#68773 (comment)).

Assisted-by: Claude Code
@aainscow
aainscow force-pushed the downlevel-osd-protection branch from 143c4ed to 8f538ac Compare November 12, 2026 18:44
@aainscow

Copy link
Copy Markdown
Contributor

(claude response) The require_osd_release upgrade test ("qa/suites/rados/upgrade: test the boot of an OSD older than require_osd_release") has moved to #72644, together with its release-checklist line. That PR holds the QA for both this PR and #72643. With 72643, raising require_osd_release also commits the upgrade to pools over zones, and the test needed a change for that.

This PR now has the fix and the checklist wording only (head 8f538ac); the other commits are unchanged. The earlier runs of the test against this PR are linked in #68773 (comment).

@aainscow

Copy link
Copy Markdown
Contributor

JonBailey1993 and others added 4 commits November 13, 2026 13:43
Currently it is still possible for a downlevel OSD to join the cluster, as explained in https://tracker.ceph.com/issues/75563. This commit adds protections to prevent this being possible. by making it so that downlevel OSDs get rejected from the cluster after you raise the require-osd-release flag.

This is necissairy as some features use this flag as a gate to decide on whether to enable new features of not. If a feature changes metadata assuming all OSDs are at the required level, its possible to add a new downlevel after this fact and cause corruption as the downlevel OSD won't be able to understand the new feature.

The flag cannot be switched until all OSDs are uplevel, but once its switched it doesn't protect against new downlevel OSDs are added. This adds in the missing piece of protection.

Signed-off-by: Jon Bailey <[email protected]>
Signed-off-by: Alex Ainscow <[email protected]>
… level OSDs after require_osd_release is set.

Signed-off-by: Jon Bailey <[email protected]>
Signed-off-by: Alex Ainscow <[email protected]>
…lease

The boot checks keyed on require_osd_release named squid, tentacle and
umbrella, so after 'ceph osd require-osd-release vampire' an Umbrella OSD
could still boot, and each later release would need another check that
its kickoff could forget. The squid and tentacle ones are already
covered by the N-2 lower bound.

Refuse an OSD that lacks the SERVER_* feature of require_osd_release,
looked up by a new ceph_release_server_feature(). unittest_features
fails while the release being built has no feature there, which the
release checklist now names instead of a per-release check.

Fixes: https://tracker.ceph.com/issues/75563
Assisted-by: Claude Code
Signed-off-by: Alex Ainscow <[email protected]>
The checklist step for the require-osd-release calls in the qa upgrade
suites still named tentacle, the release it was written for. Use X like
the other steps.

Answers Callum James' review comment on
ceph#68773
(ceph#68773 (comment)).

Assisted-by: Claude Code
Signed-off-by: Alex Ainscow <[email protected]>
@aainscow
aainscow force-pushed the downlevel-osd-protection branch from 8f538ac to 841baf6 Compare November 13, 2026 13:44
@aainscow
aainscow merged commit 335a1a7 into ceph:main Nov 13, 2026
13 of 14 checks passed
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/43450881186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants