Commit graph

190 commits

Author SHA1 Message Date
Oleksandr Byelkin
80abd847da Merge branch '10.11' into 11.1 2024-08-03 09:32:42 +02:00
Otto Kekäläinen
2adaf5c261 MDEV-33750: Sync maintainer scripts etc with latest downstream 10.11.5 in Debian
Fix a large amount of minor fixes to maintainer scripts and other done
downstream in the official Debian packaging.

Changes include:

38198d0b9e
> Limit check of running mysqld/mariadbd to system users (Closes: #1032047)
>
> If a random user has their own copy of mysqld/mariadbd running, the
> dpkg maintainer script should not care about it.

8116354d22
> Make error more helpful in case server restart fails (Related: #1033234)
>
> Bugs such as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1033234
> and https://bugs.launchpad.net/ubuntu/+source/mariadb-10.6/+bug/2011293
> show that currently dpkg stopping on service stop/start does not have
> a very helpful error message.

8675e97202
> Complement upstream commits with more complete mysql->mariadb conversion
>
> The upstream commit 952af4a1 missed some places where 'mysql' or
> 'MySQL' can and should be converted to use 'mariadb' or 'MariaDB'.

c983613300
> Fix indentation in Debian post and pre scripts
>
> There is several misindentation inside Debian post and pre
> installation scripts. False indentation with space as indent space
> should be 2 and indentation with tabs.
>
> Adopt upstream commit 7cbb45d1 in Debian by conserving customizations
> in:
> - debian/mariadb-server.postinst
> - debian/mariadb-server.postrm
> - debian/mariadb-server.preinst

d0bcab443f
> Ensure spaces are used everywhere instead of tabs for indentation

0300a9157c
> Complement previous upstream commits to fix Shellcheck issues
>
> - Unify if/then and while/do on separate lines
> - Fix indentation to be consistent
> - Use "$()" instead of backticks for subshells
> - Exit code cannot be -1, must be 0-255
> - Remove unused variables MYCHECK and MYCHECK_PARAMS
> - Rewrite messy command-line database calls to an easier to read form
>   that does exactly the same
> - Use 'command -v' test instead of 'which'
>
> With this commit, all of debian/* is Shellcheck clean.

Also
* Update mariadb.conf.d template to tell users where to create logdir
  if they are not using journald
* Remove use of work 'slave'
* Add minor workaround for Debian Bug #1022994 if TMPDIR is empty
* Make start/stop in maintainer scripts correctly check mariadbd
  ownership and only start/stop processes owned by root or 'mysql'
* Remove obsolete 'NO_UPDATE_BUILD_VERSION=1' as it did not affect the
  RocksDB build reproducibility as previously assumed
* Run 'wrap-and-sort -av'
2024-07-17 14:32:50 +10:00
Otto Kekäläinen
5000d1ba6e MDEV-33750: Increase MTR verbosity and unify skip test lists usage
- Unify on MTR_SKIP_TEST_LIST in both d/rules and autopkgtests
- Unify MTR command in both d/rules and autopkgtests
- Make d/rules section more verbose to help debugging why tests
  sometimes ran and sometimes not
- If MTR fails, make the log a bit more verbose
  (inspired by https://github.com/MariaDB/buildbot/pull/76/files)
2024-07-17 14:32:50 +10:00
Otto Kekäläinen
f79f3ada24 MDEV-33750: Fix DPKG_GENSYMBOLS_CHECK_LEVEL so it actually takes effect
The way DPKG_GENSYMBOLS_CHECK_LEVEL was exported did not actually
have any effect on the build. Fix the syntax so that build will
indeed fail if there there are new symbols in new upstream version.
2024-07-17 14:32:50 +10:00
Tuukka Pasanen
bccdc72536 MDEV-34191: Make sure that Debian respects systemd disabled
Make sure that Debian respects systemd disabled by bumping
to deb compat 11 which is available from Debian 10 and Ubuntu 20.04
and it provides better integration with systemd.

Start using dh_installsystemd which is new recommended way
in compat 11
2024-07-17 13:58:44 +10:00
Sergei Golubchik
f0a5412037 Merge branch '11.0' into 11.1 2024-05-13 09:52:30 +02:00
Sergei Golubchik
3a06964468 MDEV-33852 start the server after deb installation
and fix installation of mysql.service on buster

followup for ec09c034d8
2024-05-10 22:20:49 +02:00
Sergei Golubchik
a6b2f820e0 Merge branch '10.6' into 10.11 2024-05-10 20:02:18 +02:00
Sergei Golubchik
7b53672c63 Merge branch '10.5' into 10.6 2024-05-08 20:06:00 +02:00
Daniel Black
e63ed4e004 MDEV-33631 Ubuntu/Debian MYSQL_SERVER_SUFFIX is version+suffix on MariaDB packaged versions
The debian/rules removed sufficient version information from the
downstream version, however the mariadb upstream has a +
separator from the suffix.

While we are at it, remove the Debian/Ubuntu revision -1.

Other revisions used:
* Debian unstable (inherited to both Debian and Ubuntu if package unchanged): 1:10.11.6-2
* Ubuntu stable updates example: 1:10.11.6-0ubuntu0.23.10.2
* Debian stable updates example: 1:10.11.4-1~deb12u1

The result is compulation with:
    -DMYSQL_SERVER_SUFFIX="-1:10.4.34+maria~deb10" \

Compared to Debian:
    -DMYSQL_SERVER_SUFFIX="-1~deb12u1" \

The impact comes into play with SELECT VERSION():
    10.4.34-MariaDB-1:10.4.34+maria~deb10

A more abbreviated form of the following is much more human/machine parsable:
    10.6.16-MariaDB~ubu2004

Reviewer: Otto Kekäläinen
2024-05-01 00:57:15 +10:00
Tuukka Pasanen
ec09c034d8 MDEV-33852: Rework systemd installation on Debian
Let dh_systemd handle most of the systemd side and
get rid of custom scripts

Rework installation of systemd service and socket files
base on Michael Biebl merge request:

https://salsa.debian.org/mariadb-team/mariadb-server/-/merge_requests/63
https://salsa.debian.org/mariadb-team/mariadb-server/-/merge_requests/75
2024-04-30 17:31:06 +10:00
Marko Mäkelä
8e663f5e90 MDEV-32791 MariaDB cannot be installed on Red Hat ubi9
The libpmem dependency that had been added in
commit 3daef523af (MDEV-17084)
did not achieve any measurable performance improvement when
comparing the same PMEM device with and without "mount -o dax"
using the Linux ext4 file system.

Because Red Hat has deprecated libpmem, let us remove the code
altogether.

Note: This is a 10.6 version of
commit 3f9f5ca48e
which will retain PMEM support in MariaDB Server 10.11.
2024-04-19 11:04:51 +03:00
Marko Mäkelä
3f9f5ca48e MDEV-33447: libpmem is not available in RHEL 8
Because the Red Hat Enterprise Linux 8 core repository does not include
libpmem, let us implement the necessary subset ourselves.

pmem_persist(): Implement for 64-bit x86, ARM, POWER, RISC-V, Loongarch
in a way that should be compatible with the https://github.com/pmem/pmdk/
implementation of pmem_persist().

The CMake option WITH_INNODB_PMEM can be used for enabling or disabling
this interface at compile time. By default, it is enabled on all applicable
systems that are covered by our CI system.

Note: libpmem had not been previously enabled for Loongarch in our
Debian packaging. It was enabled for RISC-V, but we will not enable it
by default on RISC-V or Loongarch because we lack CI coverage.

The generated code for x86_64 was reviewed and tested on two
Intel implementations: one that only supports clflush, and
another that supports both clflushopt and clwb.

The generated machine code was also reviewed on https://godbolt.org
using various compiler versions. Godbolt helpfully includes an option
to compile to binary code and display the encoding, which was
useful on POWER.

Reviewed by: Vladislav Vaintroub
2024-04-19 10:54:08 +03:00
Marko Mäkelä
683fbced6b Merge 11.0 into 11.1 2024-03-28 12:15:36 +02:00
Marko Mäkelä
86c2c89743 Merge 10.6 into 10.11 2024-02-08 15:04:46 +02:00
Marko Mäkelä
91a2192bf2 Merge 10.5 into 10.6 2024-02-07 13:51:03 +02:00
Tuukka Pasanen
6914b7804d MDEV-32935: Remove unneeded CMAKE_SYSTEM_PROCESSOR parameter from Debian
There is no need for CMAKE_SYSTEM_PROCESSOR parameter in Debian
build as dh_auto_configure should handle things better and
more reliable
2024-01-30 12:22:57 +11:00
Marko Mäkelä
9b2a65e41a Merge 11.0 into 11.1 2023-10-19 08:26:16 +03:00
Marko Mäkelä
2ecc0443ec Merge 10.10 into 10.11 2023-10-17 16:04:21 +03:00
Marko Mäkelä
d5e15424d8 Merge 10.6 into 10.10
The MDEV-29693 conflict resolution is from Monty, as well as is
a bug fix where ANALYZE TABLE wrongly built histograms for
single-column PRIMARY KEY.
Also includes a fix for safe_malloc error reporting.

Other things:
- Copied main.log_slow from 10.4 to avoid mtr issue

Disabled test:
- spider/bugfix.mdev_27239 because we started to get
  +Error	1429 Unable to connect to foreign data source: localhost
  -Error	1158 Got an error reading communication packets
- main.delayed
  - Bug#54332 Deadlock with two connections doing LOCK TABLE+INSERT DELAYED
    This part is disabled for now as it fails randomly with different
    warnings/errors (no corruption).
2023-10-14 13:36:11 +03:00
Marko Mäkelä
8096139b3a Merge 10.5 into 10.6 2023-09-19 10:47:26 +03:00
Marko Mäkelä
6c05edfdcd Merge 10.4 into 10.5 2023-09-19 10:20:09 +03:00
Sergei Golubchik
cbabb95915 Merge branch '11.0' into 11.1 2023-06-05 20:15:15 +02:00
Marko Mäkelä
656c2e18b1 Merge 10.10 into 10.11 2023-04-14 13:08:28 +03:00
Marko Mäkelä
44281b88f3 Merge 10.8 into 10.9 2023-04-14 11:32:36 +03:00
Marko Mäkelä
1d1e0ab2cc Merge 10.6 into 10.8 2023-04-12 15:50:08 +03:00
Daniel Black
320a4b52c9 MDEV-30205 Move /usr/share/mysql to /usr/share/mariadb
These are mainly internal files so is a low impact change.

The few scripts/mysql*sql where renames to mariadb_* prefix
on the name.

mysql-test renamed to mariadb-test in the final packages
2023-04-11 07:59:02 +10:00
Otto Kekäläinen
2a5763224e Deb: Sync Salsa-CI from Debian MariaDB 10.6
Compare to Debian packaging of MariaDB 1:10.6.11-2 release at commit
2934e8a795
and sync upstream everything that is relevant for upstream and safe
to import on a stable 10.6 release.

* Use OpenSSL 1.1 from Debian Snapshots
  0040c272bf
  Related: https://jira.mariadb.org/browse/MDEV-30322

* Prefer using bullseye-backports in mosts tests over buster-bpo
  daa827ecde

* Add new upgrade test for MySQL Community Cluster 8.0
  3c71bec9b7

* Enable automatic datadir move also on upgrades from MySQL.com packages
  4cbbcb7e56

* Update Breaks/Replaces
  2cab13d059

* Normalize apt-get and curl commands
  8754ea2578

* Standardize on using capitalized 'ON' in CMake build options
  938757a85a

* Apply wrap-and-sort -av and other minor tweaks and inline documentation

NOTE TO MERGERS: This commit is made on 10.6 branch and can be merged to
all later branches (10.7, 10.8, ..., 11.0).
2023-04-01 23:18:51 -07:00
Marko Mäkelä
7933367a27 Merge 10.10 into 10.11 2022-11-21 10:51:10 +02:00
Marko Mäkelä
b35a048ece Merge 10.8 into 10.9 2022-11-21 10:25:38 +02:00
Marko Mäkelä
f46efb4476 Merge 10.7 into 10.8 2022-11-17 21:35:12 +02:00
Marko Mäkelä
d5332086d7 Merge 10.6 into 10.7 2022-11-17 09:19:32 +02:00
Otto Kekäläinen
f4adf35474
Misc Debian/Salsa-CI fixes (#2299)
* Deb: Handle codename 'n/a' from Debian Sid properly and autobake-deb cleanup

This fixes autobake-deb.sh builds on Sid which was visible as 4 failing
build steps on Salsa-CI.

- In Sid the LSBNAME might evaluate to 'n/a', so accept it as 'Sid' to
  fix builds that failed with error:

    Error - unknown release codename n/a

- Refactor list to have Ubuntu versions first, then Debian, and as last
  the special case of Debian Sid

- Fix minor syntax issues detected by Shellcheck

Also remove useless DEB_HOST_ARCH_CPU check from debian/rules:
* It was never in effect as the 'sed' in autobake-deb.sh cleared it anyway
* The variable name was wrong and always empty
* If variable would have been correct, logic was still reversed

- Define 3h timeout as the default 1h timeout on Gitlab.com (and others)
  is usually not enough for initial (uncached) MariaDB builds.

- Replace Buster to Bookworm/Sid upgrade testing with upgrade inside Buster
  testing as direct upgrades from Stretch to Bullseye and Buster to Bookworm
  are no longer possible due to:

    Bug#993755: libcrypt.so.1: cannot open shared object file when
    upgrading from Stretch to Sid (https://bugs.debian.org/993755)

- Stop ignoring MariaDB.org 10.6 to this version upgrade testing failures
  to reveal bug MDEV-28640. Originally this step was failing as the uring
  dependencies in upstream builders lagged behind and there was nothing
  that needed work, only time time to resolve. Now there is an actual bug
  in packaging that should be visible as a CI failure.

- Stop testing for 'service mysql status' on systems that upgraded from
  MySQL 8.0 to MariaDB.org vended 10.6. Due to some unidentified debian/control
  changes in 10.6 on upstream the upgrade is no longer compatible in
  a way that would maintain the init.d script with name 'mysql'.

- Fix typos where mergers had changed occurrences of 10.5 to 10.6 while
  they intentionally need to be exactly 10.5, otherwise the meaning
  changes.

- Align autopkgtest code with downstream official Debian packaging one.
  This is change is safe on a stable branch because is only affects builds
  and testing, not any actual usage of MariaDB 10.6.

- Standardize on using capitalized 'YES' in CMake build options
  (instead of 'yes' or mixed case)

- Add some comments to better document debian/rules

- Fix typo in Lintian overrides

Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/mariadb-10.6/+bug/1970634
MariaDB ticket: https://jira.mariadb.org/browse/MDEV-25633

When built with LTO on Ubuntu, MariaDB does not catch an exception when
the uring initialization fails due to a low RLIMIT_MEMLOCK value.

This commit amends the commit 0609b34555
to be identical to the one done downstream in Debian:
8d20ca979c

This way both the inline comments and 'git blame' for this section will
show properly why this is needed, and the fix is one that is fully tested
on Debian and Ubuntu.

Also having this section fully identical in upstream MariaDB and downstream
Debian will make the packaging maintenance easier as 'diff` runs on this
file will not flag this as a difference anymore.

In MDEV-28640 the init script failed to stop/start the MariaDB server
due to missing mysqladmin on the system. This was however very hard to
spot from the console output.

Add an explicit check for the binary the script depends on, and fail
verbosely if the dependency is missing.
2022-11-11 07:51:34 +00:00
Oleksandr Byelkin
ad937cf33a Merge branch '10.10' into 10.11 2022-11-02 13:08:01 +01:00
Oleksandr Byelkin
ebf2121529 Merge branch '10.8' into 10.9 2022-11-01 10:33:44 +01:00
Marko Mäkelä
e0421b7cc8 Merge 10.7 into 10.8 2022-11-01 08:50:28 +02:00
Oleksandr Byelkin
1ebfa2af62 Merge branch '10.6' into 10.7 2022-10-29 19:22:04 +02:00
Otto Kekäläinen
fd0dcad676 MDEV-22659: Create one single unified and optimal logrotate config
Replace mysql-log-rotate.sh and debian/...mysql-server.logrotate with one
new unified and well documented version.

Name is mariadb.logrotate.in as in 10.11 branch onward we use now the
'mariadb' name, and use 'logrotate' to match the actual name of the
utility.

Also automatically disable deprecated /etc/logrotate.d/mysql-server
file on deb upgrades.

Reviewer: Daniel Black

Reviewer edits made:
* Added 'su mysql mysql' to the logrotate this is more RPM friendly.
  This is commented on Debian
* /var/log/mysql is the path on SuSe based distributions
2022-10-27 10:28:14 +11:00
Marko Mäkelä
aeccbbd926 Merge 10.5 into 10.6
To prevent ASAN heap-use-after-poison in the MDEV-16549 part of
./mtr --repeat=6 main.derived
the initialization of Name_resolution_context was cleaned up.
2022-10-25 14:25:42 +03:00
Marko Mäkelä
9a0b9e3360 Merge 10.4 into 10.5 2022-10-25 11:26:37 +03:00
Marko Mäkelä
667d3fbbb5 Merge 10.3 into 10.4 2022-10-25 10:04:37 +03:00
Sergei Golubchik
0609b34555 disable LTO in debian builds 2022-10-22 10:24:14 +02:00
Otto Kekäläinen
d426d0782d Deb: Use --fail-missing and ensure the not-installed list is up-to-date
Make the Debian build fail if it detects that the build (CMake) created
files that are not used in any package nor accounted in the special
not-installed file.

Stop creating symbolic links in Debian packaging for files that the CMake
build already created.

Document known cases of files that are intentionally not installed.
Leave the rest in the not-installed list for visibility. The list can
later be trimmed down and having the --fail-missing will prevent any new
unaccounted files from being introduced.

Note that despite extensive refactoring in the Debian packaging files,
there was no changes in the packages produced as verified by package
files lists before and after.
2022-05-05 12:06:56 +10:00
Otto Kekäläinen
a82cdb0690 Deb: Finalize the version less Debian package transition
In addition to the binary .deb packages, also remove the version
string from the Debian source package.

Also clean away excess use of __MARIADB_MAJOR_VER__ constant
and add inline note that the whole debian-XX.X.flag file thing
should be removed and replaced by using the new MariaDB server
mysql_upgrade_info file.
2022-05-05 12:06:56 +10:00
Tuukka Pasanen
375b8f40ce MDEV-27033: Remove version suffix from Debian packages
Remove version suffix from Debian packages (for example mariadb-server-10.9)
because installing suffixed package removes older version
of package even if it's suffixed (for example mariadb-server-10.7)

This make also Debian package management easier in future MariaDB
version iterations because there is no need for stacking
Conlicts/Breaks/Replaces-parameters in every new major release
2022-04-26 12:46:39 +10:00
Marko Mäkelä
e98013cb5c Merge 10.8 into 10.9 2022-04-13 13:39:00 +03:00
Nayuta Yanagisawa
cbf9d8a8d5 Merge 10.7 into 10.8 2022-04-13 17:52:27 +09:00
Marko Mäkelä
aa3a9d1ef5 Merge 10.6 into 10.7 2022-04-12 16:11:29 +03:00
Marko Mäkelä
ca3bbf4c0c Merge 10.5 into 10.6 2022-04-12 09:26:02 +03:00
Daniel Black
dea4e178fe deb: make --output-sync=target
Rather than Debian logs containing a barely decipherable mix
of build command and the output of some other command, we
use the make option --output-sync=target. This make the compile
line and the output stay together in the output stream.

This option exists even in the make version in debian;stretch
so should work everywhere.

Test on debian:stretch, ubuntu:18.04, the two lowest version that
use the debian/rules.
2022-04-07 16:05:02 +10:00