[MDEV-28628] Debian revision should not contain codename Created: 2022-05-19  Updated: 2023-01-26  Resolved: 2022-06-14

Status: Closed
Project: MariaDB Server
Component/s: Packaging, Platform Debian
Affects Version/s: None
Fix Version/s: 10.3.36, 10.4.26, 10.5.17, 10.6.9, 10.7.5, 10.8.4, 10.9.2

Type: Bug Priority: Critical
Reporter: William Edwards Assignee: Tuukka Pasanen
Resolution: Fixed Votes: 0
Labels: debian, debian11, packaging
Environment:

Debian Bullseye


Issue Links:
Problem/Incident
causes MDEV-30478 Galera package naming is broken: same... Closed

 Description   

Created in Jira due to https://lists.launchpad.net/maria-discuss/msg06221.html

I'm attempting to upgrade a machine with MariaDB 10.6 from Buster to Bullseye using the official MariaDB repo.

I was surprised to see that apt wanted to downgrade a few packages:

$ apt upgrade --without-new-pkgs
The following packages will be DOWNGRADED:
   libmariadb-dev libmariadb-dev-compat libmariadb3 mysql-common

I was confused at first, as the priority of the candidate is higher, and the epoch is unchanged, and the upstream version is unchanged:

$ apt policy mysql-common
mysql-common:
   Installed: 1:10.6.7+maria~buster
   Candidate: 1:10.6.7+maria~bullseye
   Version table:
  *** 1:10.6.7+maria~buster 100
         100 /var/lib/dpkg/status
      1:10.6.7+maria~bullseye 1000
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main amd64 Packages
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main arm64 Packages
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main ppc64el Packages
      1:10.6.5+maria~bullseye 1000
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main amd64 Packages
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main arm64 Packages
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main ppc64el Packages
      1:10.6.4+maria~bullseye 1000
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main amd64 Packages
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main arm64 Packages
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main ppc64el Packages
      5.8+1.0.7 500
         500 http://debmirror.tuxis.nl/debian bullseye/main amd64
Packages
$ apt policy libmariadb3
libmariadb3:
   Installed: 1:10.6.7+maria~buster
   Candidate: 1:10.6.7+maria~bullseye
   Version table:
  *** 1:10.6.7+maria~buster 100
         100 /var/lib/dpkg/status
      1:10.6.7+maria~bullseye 1000
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main amd64 Packages
      1:10.6.5+maria~bullseye 1000
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main amd64 Packages
      1:10.6.4+maria~bullseye 1000
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main amd64 Packages
      1:10.5.15-0+deb11u1 500
         500 http://debmirror.tuxis.nl/debian bullseye/main amd64
Packages
$ apt policy libmariadb-dev-compat
libmariadb-dev-compat:
   Installed: 1:10.6.7+maria~buster
   Candidate: 1:10.6.7+maria~bullseye
   Version table:
  *** 1:10.6.7+maria~buster 100
         100 /var/lib/dpkg/status
      1:10.6.7+maria~bullseye 1000
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main amd64 Packages
      1:10.6.5+maria~bullseye 1000
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main amd64 Packages
      1:10.6.4+maria~bullseye 1000
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main amd64 Packages
      1:10.5.15-0+deb11u1 500
         500 http://debmirror.tuxis.nl/debian bullseye/main amd64
Packages
$ apt policy libmariadb-dev
libmariadb-dev:
   Installed: 1:10.6.7+maria~buster
   Candidate: 1:10.6.7+maria~bullseye
   Version table:
  *** 1:10.6.7+maria~buster 100
         100 /var/lib/dpkg/status
      1:10.6.7+maria~bullseye 1000
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main amd64 Packages
      1:10.6.5+maria~bullseye 1000
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main amd64 Packages
      1:10.6.4+maria~bullseye 1000
        1000
http://ams2.mirrors.digitalocean.com/mariadb/repo/10.6/debian
bullseye/main amd64 Packages
      1:10.5.15-0+deb11u1 500
         500 http://debmirror.tuxis.nl/debian bullseye/main amd64
Packages

A simulation also reported that apt would 'downgrade' to the same versions:

$ apt upgrade --without-new-pkgs -s
Inst libmariadb-dev [1:10.6.7+maria~buster] (1:10.6.7+maria~bullseye
MariaDB:ams2.mirrors.digitalocean.com [amd64]) []
Inst libmariadb-dev-compat [1:10.6.7+maria~buster]
(1:10.6.7+maria~bullseye MariaDB:ams2.mirrors.digitalocean.com [amd64])
[]
Inst libmariadb3 [1:10.6.7+maria~buster] (1:10.6.7+maria~bullseye
MariaDB:ams2.mirrors.digitalocean.com [amd64])
Inst mysql-common [1:10.6.7+maria~buster] (1:10.6.7+maria~bullseye
MariaDB:ams2.mirrors.digitalocean.com [all])

Some folks on IRC pointed me to the fact that the Debian revision has been updated from `maria~buster` to `maria~bullseye`. The documentation at https://www.debian.org/doc/debian-policy/ch-controlfields.html#special-version-conventions says:

The lexical comparison is a comparison of ASCII values modified so that all the letters sort earlier than all the non-letters and so that a tilde sorts before anything, even the end of a part.

'bul' comes before 'bus', so the package for Bullseye is perceived as older, despite it being the same effective upstream version...

According to https://www.debian.org/doc/debian-policy/ch-controlfields.html#special-version-conventions, the Debian revision should NOT contain the Debian release codename. This problem will re-appear with Bookworm.



 Comments   
Comment by Tuukka Pasanen [ 2022-05-20 ]

Thanks for pointing this out and yes lexical comparison if it's done that way will have results as you noted as thought if it's calculated whole bullseye should be greater than buster as just dummy calculating it's whole in ascii it's bigger without thinking lexical stuff.
But this should be solved way or another as you are probably not the only one who is suffering this.

Comment by William Edwards [ 2022-05-20 ]

> But this should be solved way or another as you are probably not the only one who is suffering this.

Yes, I am surprised that I can't find any other reports.

Comment by Otto Kekäläinen [ 2022-05-25 ]

The `+maria` suffix is used to ensure that the package version is evaluated higher than the native Debian packages: Version 1:10.6.7+maria will upgrade/install on top of version 1:10.6.7-1.

If you want to ensure that 1:10.6.7+maria for Bullseye will upgrade on top of 1:10.6.7+maria for Bullseye, change the name to something fixed and an increasing number: 1:10.6.7+mariadb~deb11 will upgrade/install on top of version 1:10.6.7+mariadb~deb10. The `+` has no other special meaning than being larger than `-`. Also `~` has no special meaning apart from being smaller than plus, minus or even nothing. The characters plus, minus and tilde are used often to avoid using dots and underscores, as they are often used in the package name or proper version.

Comment by William Edwards [ 2022-05-25 ]

I'm not sure if your comment is aimed at me. The package maintainers should fix this.

Comment by Tuukka Pasanen [ 2022-05-27 ]

wedwards Yes that meant for me mainly I think.

otto after I read that Debian spec and Man page about this I got kind of idea that char '~' means upstream git build where it should contain GIT/Build revision.
I tested on Salsa-CI build with revision like:
mariadb-server_10.6.7+mariaunstableu2804034_amd64.deb
As it's build on sid LSB version number is 'unstable' and it look kind of strange but when you have for example Bulleye then revision would be 'maria11u2804034'. I don't know if add Salsa-CI/BB Build number after char 'u' if necessary but if you test with then you can easily see from what Sid build it is but it's purely optional. Docs say that it should be something like 'deb11u(Some number here)' but as specs is bit unclear in some parts I can be completely wrong with this.

Comment by Otto Kekäläinen [ 2022-05-30 ]

The char '~' does not mean upstream git build. You can have anything you want in the version strings, the only thing to consider is that lexical ordering the chars have. The tilde is special in that is it in lexical order before space/empty. Thus '1:10.6.7+mariadb~deb11' is newer than say '1:10.6.7+mariadb11u123456f'.

Just use 'deb11' and 'deb10' instead of 'bullseye' and 'buster' and the problem in this Jira is solved.

Comment by Tuukka Pasanen [ 2022-05-31 ]

Now revision is like:

for Debian 11 is now:
1:10.6.8+maria~deb11

Ubuntu 22.04 is now:
1:10.6.8+maria~ubu2204

Comment by Tuukka Pasanen [ 2022-05-31 ]

wedwards do you have capability to compile and test current new naming?

Comment by Tuukka Pasanen [ 2022-05-31 ]

wedwards It's currently for MariaDB 10.3 I can upgrade it for 10.6 if you need it

Comment by William Edwards [ 2022-05-31 ]

Tuukka Pasanen I will test your PR right now and report back.

I think this should be fixed for all MariaDB versions that are available in the Bullseye repo: 10.9, 10.8, 10.7, 10.6, 10.5

Comment by Tuukka Pasanen [ 2022-05-31 ]

After it goes to 10.3 it will be merged up

Comment by William Edwards [ 2022-06-01 ]

Tuukka Pasanen Please update your PR for MariaDB 10.6.8. I can test it then.

Comment by Tuukka Pasanen [ 2022-06-01 ]

Thank you for interest wedwards and please pull my Debian Salsa branch:
https://salsa.debian.org/illuusio/mariadb-server/-/tree/10.6-MDEV-28628-fix-codename

There is also CI running
https://salsa.debian.org/illuusio/mariadb-server/-/pipelines/384832
but it creates Debian Sid binaries and if you don't use unstable they are not for you

If building with Docker or Debian 11 you might need:

git clone https://salsa.debian.org/illuusio/mariadb-server
cd mariadb-server
git checkout 10.6-MDEV-28628-fix-codename
apt-get install git-buildpackage
mk-build-deps -r -i debian/control -t "apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends"
GITLAB_CI=1 debian/autobake-deb.sh

there can be some dependencies that has to be added by hand which are not automaticly pull with mk-build-deps

If build fails you can return to zero state:

git clean -fdx && git reset --hard

I have problems without GITLAB_CI=1 and have to check why there is problem with Columnstore build in my Debian 11.

Please ask if you encounter problem

Comment by William Edwards [ 2022-06-01 ]

Tuukka, thanks for the instructions. The packages were built successfully, but they are for 10.6.9, while I need 10.6.8 to reproduce the problem. I changed `MYSQL_VERSION_PATCH` from '9' to '8' in `VERSION`, hopefully that helps. It's building at the moment.

Comment by William Edwards [ 2022-06-01 ]

Tuukka Pasanen I can confirm that the packages that end with `~deb11` are perceived as newer than the packages ending with `~buster`. Below is a transcript of a simulated upgrade from `10.6.8+maria~buster` to `10.6.8+maria~deb11`. apt does not attempt to downgrade any packages.

root@debian11-test:~# apt install -s ./*.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'libmariadb3' instead of './libmariadb3_10.6.8+maria~deb11_amd64.deb'
Note, selecting 'libmariadb-dev' instead of './libmariadb-dev_10.6.8+maria~deb11_amd64.deb'
Note, selecting 'libmariadb-dev-compat' instead of './libmariadb-dev-compat_10.6.8+maria~deb11_amd64.deb'
Note, selecting 'libreadline5' instead of './libreadline5_5.2+dfsg-3+b13_amd64.deb'
Note, selecting 'libreadline-gplv2-dev' instead of './libreadline-gplv2-dev_5.2+dfsg-3+b13_amd64.deb'
Note, selecting 'mariadb-client-10.6' instead of './mariadb-client-10.6_10.6.8+maria~deb11_amd64.deb'
Note, selecting 'mariadb-client-core-10.6' instead of './mariadb-client-core-10.6_10.6.8+maria~deb11_amd64.deb'
Note, selecting 'mariadb-common' instead of './mariadb-common_10.6.8+maria~deb11_all.deb'
Note, selecting 'mariadb-server-10.6' instead of './mariadb-server-10.6_10.6.8+maria~deb11_amd64.deb'
Note, selecting 'mariadb-server-core-10.6' instead of './mariadb-server-core-10.6_10.6.8+maria~deb11_amd64.deb'
libreadline5 is already the newest version (5.2+dfsg-3+b13).
The following additional packages will be installed:
  fontconfig-config fonts-dejavu-core libc-dev-bin libc-devtools libc6-dev libcrypt-dev libdeflate0 libfontconfig1 libgd3 libjbig0 libjpeg62-turbo libncurses-dev libnsl-dev libssl-dev libtiff5 libtinfo-dev libtirpc-dev libwebp6 libxpm4 linux-libc-dev manpages-dev zlib1g-dev
Suggested packages:
  glibc-doc libgd-tools ncurses-doc libssl-doc mailx mariadb-test netcat-openbsd
The following NEW packages will be installed:
  fontconfig-config fonts-dejavu-core libc-dev-bin libc-devtools libc6-dev libcrypt-dev libdeflate0 libfontconfig1 libgd3 libjbig0 libjpeg62-turbo libmariadb-dev libmariadb-dev-compat libncurses-dev libnsl-dev libreadline-gplv2-dev libssl-dev libtiff5 libtinfo-dev libtirpc-dev libwebp6 libxpm4 linux-libc-dev manpages-dev zlib1g-dev
The following packages will be upgraded:
  libmariadb3 mariadb-client-10.6 mariadb-client-core-10.6 mariadb-common mariadb-server-10.6 mariadb-server-core-10.6
6 upgraded, 25 newly installed, 0 to remove and 0 not upgraded.
Inst mariadb-common [1:10.6.8+maria~buster] (1:10.6.8+maria~deb11 local-deb [all])
Inst libmariadb3 [1:10.6.8+maria~buster] (1:10.6.8+maria~deb11 local-deb [amd64])
Remv mariadb-client-10.6 [1:10.6.8+maria~buster] [mariadb-server-10.6:amd64 ]
Conf mariadb-common (1:10.6.8+maria~deb11 local-deb [all]) [mariadb-server-10.6:amd64 ]
Inst mariadb-server-10.6 [1:10.6.8+maria~buster] (1:10.6.8+maria~deb11 local-deb [amd64]) []
Inst mariadb-server-core-10.6 [1:10.6.8+maria~buster] (1:10.6.8+maria~deb11 local-deb [amd64]) []
Inst mariadb-client-core-10.6 [1:10.6.8+maria~buster] (1:10.6.8+maria~deb11 local-deb [amd64]) []
Inst mariadb-client-10.6 [1:10.6.8+maria~buster] (1:10.6.8+maria~deb11 local-deb [amd64])
Inst fonts-dejavu-core (2.37-2 Debian:11.3/stable [all])
Inst fontconfig-config (2.13.1-4.2 Debian:11.3/stable [all])
Inst libc-dev-bin (2.31-13+deb11u3 Debian:11.3/stable [amd64])
Inst libfontconfig1 (2.13.1-4.2 Debian:11.3/stable [amd64])
Inst libjpeg62-turbo (1:2.0.6-4 Debian:11.3/stable [amd64])
Inst libdeflate0 (1.7-1 Debian:11.3/stable [amd64])
Inst libjbig0 (2.1-3.1+b2 Debian:11.3/stable [amd64])
Inst libwebp6 (0.6.1-2.1 Debian:11.3/stable [amd64])
Inst libtiff5 (4.2.0-1+deb11u1 Debian-Security:11/stable-security [amd64])
Inst libxpm4 (1:3.5.12-1 Debian:11.3/stable [amd64])
Inst libgd3 (2.3.0-2 Debian:11.3/stable [amd64])
Inst libc-devtools (2.31-13+deb11u3 Debian:11.3/stable [amd64])
Inst linux-libc-dev (5.10.113-1 Debian-Security:11/stable-security [amd64])
Inst libcrypt-dev (1:4.4.18-4 Debian:11.3/stable [amd64])
Inst libtirpc-dev (1.3.1-1 Debian:11.3/stable [amd64])
Inst libnsl-dev (1.3.0-2 Debian:11.3/stable [amd64])
Inst libc6-dev (2.31-13+deb11u3 Debian:11.3/stable [amd64])
Inst libssl-dev (1.1.1n-0+deb11u2 Debian-Security:11/stable-security [amd64])
Inst zlib1g-dev (1:1.2.11.dfsg-2+deb11u1 Debian-Security:11/stable-security [amd64])
Inst libmariadb-dev (1:10.6.8+maria~deb11 local-deb [amd64])
Inst libmariadb-dev-compat (1:10.6.8+maria~deb11 local-deb [amd64])
Inst libncurses-dev (6.2+20201114-2 Debian:11.3/stable [amd64])
Inst libtinfo-dev (6.2+20201114-2 Debian:11.3/stable [amd64])
Inst manpages-dev (5.10-1 Debian:11.3/stable [all])
Inst libreadline-gplv2-dev (5.2+dfsg-3+b13 local-deb [amd64])
Conf libmariadb3 (1:10.6.8+maria~deb11 local-deb [amd64])
Conf mariadb-server-10.6 (1:10.6.8+maria~deb11 local-deb [amd64])
Conf mariadb-server-core-10.6 (1:10.6.8+maria~deb11 local-deb [amd64])
Conf mariadb-client-core-10.6 (1:10.6.8+maria~deb11 local-deb [amd64])
Conf mariadb-client-10.6 (1:10.6.8+maria~deb11 local-deb [amd64])
Conf fonts-dejavu-core (2.37-2 Debian:11.3/stable [all])
Conf fontconfig-config (2.13.1-4.2 Debian:11.3/stable [all])
Conf libc-dev-bin (2.31-13+deb11u3 Debian:11.3/stable [amd64])
Conf libfontconfig1 (2.13.1-4.2 Debian:11.3/stable [amd64])
Conf libjpeg62-turbo (1:2.0.6-4 Debian:11.3/stable [amd64])
Conf libdeflate0 (1.7-1 Debian:11.3/stable [amd64])
Conf libjbig0 (2.1-3.1+b2 Debian:11.3/stable [amd64])
Conf libwebp6 (0.6.1-2.1 Debian:11.3/stable [amd64])
Conf libtiff5 (4.2.0-1+deb11u1 Debian-Security:11/stable-security [amd64])
Conf libxpm4 (1:3.5.12-1 Debian:11.3/stable [amd64])
Conf libgd3 (2.3.0-2 Debian:11.3/stable [amd64])
Conf libc-devtools (2.31-13+deb11u3 Debian:11.3/stable [amd64])
Conf linux-libc-dev (5.10.113-1 Debian-Security:11/stable-security [amd64])
Conf libcrypt-dev (1:4.4.18-4 Debian:11.3/stable [amd64])
Conf libtirpc-dev (1.3.1-1 Debian:11.3/stable [amd64])
Conf libnsl-dev (1.3.0-2 Debian:11.3/stable [amd64])
Conf libc6-dev (2.31-13+deb11u3 Debian:11.3/stable [amd64])
Conf libssl-dev (1.1.1n-0+deb11u2 Debian-Security:11/stable-security [amd64])
Conf zlib1g-dev (1:1.2.11.dfsg-2+deb11u1 Debian-Security:11/stable-security [amd64])
Conf libmariadb-dev (1:10.6.8+maria~deb11 local-deb [amd64])
Conf libmariadb-dev-compat (1:10.6.8+maria~deb11 local-deb [amd64])
Conf libncurses-dev (6.2+20201114-2 Debian:11.3/stable [amd64])
Conf libtinfo-dev (6.2+20201114-2 Debian:11.3/stable [amd64])
Conf manpages-dev (5.10-1 Debian:11.3/stable [all])
Conf libreadline-gplv2-dev (5.2+dfsg-3+b13 local-deb [amd64])

Comment by Tuukka Pasanen [ 2022-06-02 ]

wedwards thank you for testing this.

Comment by William Edwards [ 2022-06-03 ]

Tuukka Pasanen Thanks for your quick fix. Is there any ETA for a merge?

Comment by Tuukka Pasanen [ 2022-06-07 ]

Hopefully soon.. If you want to get it in faster please review on GIthub.

Comment by William Edwards [ 2022-06-07 ]

Tuukka Pasanen Hopefully someone more qualified will have time soon

Comment by Daniel Black [ 2022-06-14 ]

Thanks for the bug report wedwards.

Thanks for the fix illuusio.

Next version will be renamed in a debian/ubuntu aware order.

Comment by William Edwards [ 2022-06-14 ]

Thank you all very much!

Generated at Thu Feb 08 10:02:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.