Skip to content

debian,ceph.spec: fix ceph-osd upgrade conflicts#66568

Merged
tchaikov merged 1 commit intoceph:mainfrom
Matan-B:wip-matanb-crimson-obselte
Dec 12, 2025
Merged

debian,ceph.spec: fix ceph-osd upgrade conflicts#66568
tchaikov merged 1 commit intoceph:mainfrom
Matan-B:wip-matanb-crimson-obselte

Conversation

@Matan-B
Copy link
Contributor

@Matan-B Matan-B commented Dec 9, 2025

With #65782 merged, upgrading ceph-osd would need to replace the previous ceph-osd existing on the machine. Otherwise, we won't be able to symlink the newly installed package:

2025-12-05T21:09:20.472 INFO:teuthology.orchestra.run.smithi077.stdout:
Installing       : ceph-osd-classic-2:20.3.0-4434.g8611241d.el9.x86_6
24/87
2025-12-05T21:09:20.478 INFO:teuthology.orchestra.run.smithi077.stdout:
Running scriptlet: ceph-osd-classic-2:20.3.0-4434.g8611241d.el9.x86_6
24/87
2025-12-05T21:09:20.479
INFO:teuthology.orchestra.run.smithi077.stdout:failed to link
/usr/bin/ceph-osd -> /etc/alternatives/ceph-osd: /usr/bin/ceph-osd
exists and it is not a symlink

See: #66341 (comment)

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.

debian/control Outdated
${misc:Depends},
${shlibs:Depends},
Conflicts: ceph-osd (<< 20.3)
Replaces: ceph-osd (<< 20.3)
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of making ceph-osd conflict with ceph-osd, we might want to make ceph-osd-classic and ceph-osd-crimson conflict with ceph-osd (<< 20.3). because ceph-osd cannot coexist with another version of ceph-osd, so they inherently conflicts with each other. but in the failure, it was ceph-osd-classic which tried to create a symbolic link to /usr/bin/ceph-osd, which was a file provided by ceph-osd (<< 20.3).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, thanks. Updating

@Matan-B Matan-B force-pushed the wip-matanb-crimson-obselte branch from 1d8274e to 69b37bc Compare December 9, 2025 10:55
@Matan-B Matan-B requested a review from tchaikov December 9, 2025 10:55
@Matan-B
Copy link
Contributor Author

Matan-B commented Dec 9, 2025

@Matan-B Matan-B force-pushed the wip-matanb-crimson-obselte branch from 69b37bc to 16cc623 Compare December 9, 2025 14:07
@cbodley
Copy link
Contributor

cbodley commented Dec 9, 2025

thank you!

https://shaman.ceph.com/builds/ceph/wip-matanb-crimson-obselte-v2

it looks like builds are failing while quay.ceph.io is being migrated

@athanatos athanatos removed their request for review December 9, 2025 17:16
Copy link
Contributor

@tchaikov tchaikov left a comment

Choose a reason for hiding this comment

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

lgtm

@cbodley
Copy link
Contributor

cbodley commented Dec 10, 2025

it looks like builds are failing while quay.ceph.io is being migrated

fresh builds in https://shaman.ceph.com/builds/ceph/wip-matanb-crimson-obselte/, i'll run the rgw/upgrade suite to verify

@cbodley
Copy link
Contributor

cbodley commented Dec 10, 2025

fresh builds in https://shaman.ceph.com/builds/ceph/wip-matanb-crimson-obselte/, i'll run the rgw/upgrade suite to verify

from https://qa-proxy.ceph.com/teuthology/cbodley-2025-12-10_16:12:38-rgw:upgrade-wip-matanb-crimson-obselte-distro-default-smithi/8649442/teuthology.log,

   Installing       : ceph-osd-crimson-2:20.3.0-4335.ga39cb79c.el9.x86_6   20/85
  Running scriptlet: ceph-osd-crimson-2:20.3.0-4335.ga39cb79c.el9.x86_6   20/85
failed to link /usr/bin/ceph-osd -> /etc/alternatives/ceph-osd: /usr/bin/ceph-osd exists and it is not a symlink

  Upgrading        : ceph-volume-2:20.3.0-4335.ga39cb79c.el9.noarch       21/85
  Running scriptlet: ceph-volume-2:20.3.0-4335.ga39cb79c.el9.noarch       21/85
  Upgrading        : ceph-osd-2:20.3.0-4335.ga39cb79c.el9.x86_64          22/85
  Running scriptlet: ceph-osd-2:20.3.0-4335.ga39cb79c.el9.x86_64          22/85
  Installing       : ceph-osd-classic-2:20.3.0-4335.ga39cb79c.el9.x86_6   23/85
  Running scriptlet: ceph-osd-classic-2:20.3.0-4335.ga39cb79c.el9.x86_6   23/85
failed to link /usr/bin/ceph-osd -> /etc/alternatives/ceph-osd: /usr/bin/ceph-osd exists and it is not a symlink

@tchaikov
Copy link
Contributor

@cbodley Thanks for testing.

@Matan-B I realized that the right fix is to use

    fi
    %endif

-  %post osd-classic
+  %posttrans osd-classic
   %{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
       %{_bindir}/ceph-osd-classic 100

As this is the standard RPM practice for file-to-symlink transitions, as documented in the Fedora packaging guidelines. No hacks, no file manipulation, just proper use of the RPM scriptlet ordering.

Sources:

@Matan-B
Copy link
Contributor Author

Matan-B commented Dec 11, 2025

@cbodley Thanks for testing.

@Matan-B I realized that the right fix is to use

    fi
    %endif

-  %post osd-classic
+  %posttrans osd-classic
   %{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
       %{_bindir}/ceph-osd-classic 100

As this is the standard RPM practice for file-to-symlink transitions, as documented in the Fedora packaging guidelines. No hacks, no file manipulation, just proper use of the RPM scriptlet ordering.

Sources:

Thanks Kefu! IIUC we still need Obsoletes. right? So that the posttrans scriplet would run afterwards?

@tchaikov
Copy link
Contributor

yup, we still need to have Obsoletes in both new packages.

@Matan-B Matan-B force-pushed the wip-matanb-crimson-obselte branch from 16cc623 to 75f5fab Compare December 11, 2025 11:55
With ceph#65782 merged, upgrading ceph-osd
would need to replace the previous ceph-osd existing on the machine.
Otherwise, we won't be able to symlink the newly installed package:
```
2025-12-05T21:09:20.472 INFO:teuthology.orchestra.run.smithi077.stdout:
Installing       : ceph-osd-classic-2:20.3.0-4434.g8611241d.el9.x86_6
24/87
2025-12-05T21:09:20.478 INFO:teuthology.orchestra.run.smithi077.stdout:
Running scriptlet: ceph-osd-classic-2:20.3.0-4434.g8611241d.el9.x86_6
24/87
2025-12-05T21:09:20.479
INFO:teuthology.orchestra.run.smithi077.stdout:failed to link
/usr/bin/ceph-osd -> /etc/alternatives/ceph-osd: /usr/bin/ceph-osd
exists and it is not a symlink
```

Note: debian/control ceph-osd-classic already had Replace and Breaks:
      - Breaks is replaced with Conflicts to not allow coexistence.
      - Release version is bumped up to be relevant for latest main

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
@Matan-B Matan-B force-pushed the wip-matanb-crimson-obselte branch from 75f5fab to 9f1c8f9 Compare December 11, 2025 11:56
@Matan-B
Copy link
Contributor Author

Matan-B commented Dec 11, 2025

https://shaman.ceph.com/builds/ceph/wip-matanb-crimson-obselte/75f5fabf542fa70eecaf48b997ce1b9bba3ea04a/

looks promising:
https://pulpito.ceph.com/matan-2025-12-11_13:29:42-rgw:singleton-wip-matanb-crimson-obselte-distro-default-smithi/

2025-12-11T13:46:39.823 INFO:teuthology.orchestra.run.smithi202.stdout:  Installing       : lksctp-tools-1.0.19-2.el9.x86_64                       5/8
2025-12-11T13:46:39.835 INFO:teuthology.orchestra.run.smithi168.stdout:  Running scriptlet: ceph-osd-classic-2:20.3.0-4335.g75f5fabf.el9.x86_6   36/36
2025-12-11T13:46:39.866 INFO:teuthology.orchestra.run.smithi202.stdout:  Installing       : hwloc-libs-2.4.1-6.el9.x86_64                          6/8

upgrade testing:
https://pulpito.ceph.com/matan-2025-12-11_14:16:47-rgw:upgrade-wip-matanb-crimson-obselte-distro-default-smithi/

@tchaikov
Copy link
Contributor

jenkins test make check arm64

@tchaikov
Copy link
Contributor

jenkins test api

Copy link
Contributor

@cbodley cbodley left a comment

Choose a reason for hiding this comment

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

@Matan-B Matan-B moved this from Needs QA to Tested in Crimson Dec 11, 2025
@tchaikov
Copy link
Contributor

now that the upgrade tests passed. i am merging this change.

@tchaikov tchaikov merged commit 3eac3d9 into ceph:main Dec 12, 2025
13 checks passed
@Matan-B Matan-B moved this from Tested to Merged (Main) in Crimson Dec 14, 2025
@vshankar
Copy link
Contributor

tyvm @Matan-B @tchaikov

Thanks for taking care of this @Matan-B @tchaikov

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

Projects

Status: Merged (Main)

Development

Successfully merging this pull request may close these issues.

4 participants