]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
debian,ceph.spec: fix ceph-osd upgrade conflicts
authorMatan Breizman <mbreizma@redhat.com>
Tue, 9 Dec 2025 09:52:08 +0000 (09:52 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Thu, 11 Dec 2025 11:56:46 +0000 (11:56 +0000)
With https://github.com/ceph/ceph/pull/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>
ceph.spec.in
debian/control

index 66f2973b5842872bb082eaf954991de59f25bde6..45435898907e72a6c51b17662e3e3b81003e940a 100644 (file)
@@ -933,6 +933,7 @@ Summary:    Ceph Object Storage Daemon (classic)
 Group:         System/Filesystems
 %endif
 Requires:   ceph-osd = %{_epoch_prefix}%{version}-%{release}
+Obsoletes:  ceph-osd < %{_epoch_prefix}%{version}-%{release}
 %description osd-classic
 classic-osd is the object storage daemon for the Ceph distributed file
 system.  It is responsible for storing objects on a local file system
@@ -945,6 +946,7 @@ Summary:    Ceph Object Storage Daemon (crimson)
 Group:         System/Filesystems
 %endif
 Requires:      ceph-osd = %{_epoch_prefix}%{version}-%{release}
+Obsoletes:     ceph-osd < %{_epoch_prefix}%{version}-%{release}
 Requires:      binutils
 Requires:      protobuf
 %description osd-crimson
@@ -2348,7 +2350,7 @@ fi
 %{_bindir}/ceph-osd-crimson
 %{_bindir}/crimson-objectstore-tool
 
-%post osd-crimson
+%posttrans osd-crimson
 %{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
     %{_bindir}/ceph-osd-crimson 50
 
@@ -2358,7 +2360,7 @@ if [ $1 -eq 0 ]; then
 fi
 %endif
 
-%post osd-classic
+%posttrans osd-classic
 %{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
     %{_bindir}/ceph-osd-classic 100
 
index 692e5eaa8b978c6557fcabc4331202ea3bda3944..dc518bac36eef7756a76f366246b386baca8b46e 100644 (file)
@@ -451,16 +451,16 @@ Package: ceph-osd-classic
 Architecture: linux-any
 Depends: ceph-base (= ${binary:Version}),
          ${misc:Depends},
-         ${shlibs:Depends},
+         ${shlibs:Depends}
+Conflicts: ceph-osd (<< 20.3)
 Replaces: ceph (<< 10),
           ceph-test (<< 12.2.2-14),
-          ceph-osd (<< 20.1.1)
+          ceph-osd (<< 20.3)
 Breaks: ceph (<< 10),
-        ceph-test (<< 12.2.2-14),
-        ceph-osd (<< 20.1.1)
+        ceph-test (<< 12.2.2-14)
 Recommends: ceph-volume (= ${binary:Version}),
             nvme-cli,
-            smartmontools,
+            smartmontools
 Description: Classic OSD server for the ceph storage system
  Ceph is a massively scalable, open-source, distributed
  storage system that runs on commodity hardware and delivers object,
@@ -494,6 +494,8 @@ Depends: ceph-base (= ${binary:Version}),
 Recommends: ceph-volume (= ${binary:Version}),
             nvme-cli,
             smartmontools,
+Conflicts: ceph-osd (<< 20.3)
+Replaces:  ceph-osd (<< 20.3)
 Description: Crimson OSD server for the ceph storage system
  Ceph is a massively scalable, open-source, distributed
  storage system that runs on commodity hardware and delivers object,