Commit Graph

159 Commits

Author SHA1 Message Date
eaf65f5053 Make 10.6 for jammy 2025-06-12 19:02:30 +10:00
bc72d89291 focal EOL for 10.5/10.6 2025-06-10 09:22:06 +10:00
c5669903a1 Stable 2025 Q1 updates 2025-05-09 08:37:00 +10:00
3bfeae408b 2025 Q1 Maintaince release version bump
10.5.28, 10.6.21, 10.11.11, and 11.4.5 releases
2025-02-06 08:06:18 +11:00
38dfbc5997 MariaDB 2025 Q1 maintence release
For 10.5, 10.6, 10.11 and 11.4
2025-02-05 14:31:26 +11:00
d5561744cc healthcheck.sh add --no-connect option
There is an implicit --connect option in healthcheck
so that a normal use can be sure MariaDB is running
on a tcp socket.

There is a case in /docker-entrypoint-initdb.d where
its desirable to perform healthchecks for components
without a --connect. In this case, use --no-connect
in the healthcheck to avoid an implicit --connect test.
2024-09-17 17:29:54 +10:00
5947241c87 MDEV-34943 Disable replication start on initialization
START REPLIA was issued during initializing which mean that
even before /docker-entrypoint/initdb.d there was initializtion
going on.

Entrypoints that needed data initialzation didn't complete with
this nicely. Also if there wasn't any initialization there
would be little time for the replication to acheive anything
before being shutdown ready for the final start.

Moved --skip-slave-start to the default docker_temp_server_start
implementation.

Technically this is a compaibility break that is likely to be
of significants if:
* /docker-entrypoint/initdb.d contains a script waiting
  for replication to catch up.

The recitifcation to the previous behaviour is:
/docker-entrypoint/initdb.d contains a SQL to START REPLICA.
Recommend also having another script that is:

until healthcheck.sh --replication_io \
                     --replication_sql \
                     --replication_seconds_behind_master=0 \
                     --replication
                     --no-connect;
do
  sleep 1
done

Closes #614
2024-09-17 17:29:54 +10:00
ee80a97d5c healthcheck correct connect result
Based on user reports, a `connect` test can observer a non-"Can't
connect" error message.

Because this passes other tests, like innodb_initialized might
succeeded.

The final test -z "$connect_s" is also true, leaving the user
with an incorrect test result.

Maybe the healthcheck cnf hasn't been created yet?

Either way, ruggardise the final test to ensure a healthy connect
test occured.

Narrow down the scope of healthcheck --connect failures
to the mariadb client errors "Can't connect".

May as well look at same @skip-networking system variable
on TCP just in case.

28000 errors, per
https://mariadb.com/kb/en/mariadb-error-code-reference/ are client
errors after a connection, indicating that the start of a tcp
connection occured.

Closes #610
2024-09-03 12:17:54 +10:00
29f8caccc4 Remove Annoying root user banner
Closes #608
2024-09-02 13:20:45 +10:00
8b9a47d054 fix < 11.5 version number due to prev release hack 2024-08-15 14:29:43 +10:00
fb80850635 manually bumped version for <= 11.4 2024-08-09 09:52:24 +10:00
2611c396fb correct healthcheck.sh under --require-secure-transport
require-secure-transport on the server mandates that tls or
unix socket be used. The healthcheck user doesn't have explict
tls credentials, so would have failed. 11.4+ would have
tls negiotated, except in #594 it was disabled for people that
didn't configure ssl-ca correctly.

To resolve this _process_sql adds an explict --protocol socket
to get around the default configuration of 'protocol=tcp' in
.my-healthcheck.sh. The protocol=tcp was there to catch people
who put `healthcheck.sh --innodb_initialized` to discover it
checked that in the starting phase of the container, without
a tcp connection being available, it still returned true.

We work around this my making a connection test always
occur in the healthcheck.

Remove the protocol=tcp from the generation of .my-healthcheck.cnf
files.

--connect, as a method that requires to test the connection,
we add a mechanims that examines @@skip_networking and considers
that if false, the connection is viable. We made a unix socket
connection to do the test, which is active the same time as tcp
sockets are.

This alternate --connect method would have only worked the
credentials of the healthcheck user where valid. If it isn't
fall back to looking for "Can't connect".

Closes: #596
2024-06-27 12:42:21 +10:00
366c041cdb @bstract sockets - do not chown 2024-06-27 12:42:06 +10:00
0de351bfed chowns are non-fatal
There may be cases where specific files are readonly,
like .my-healthcheck.cnf due to filesystem mounts.

So lets make the ownership/permission changes optional.

Closes: #573
2024-06-27 12:42:06 +10:00
aecdf2e613 Rebase templates on the latest version rather than earliest
Correct healthcheck.sh comments.

Few minor errors in later versions corrected.

11.6 upgrade file corrected.

More resiliant to version changes.

Remove mysql/mariadb safe.cnf file that isn't distributed
from Dockerfile.
2024-06-20 18:00:53 +10:00
81c4ce7965 Skip ssl on docker_temp_server_start
And checking it when seeing if the server is started.

Closes: #592
2024-06-11 12:37:24 +10:00
44ed2e2312 Hardcode version into entrypoint rather than rely on env 2024-05-20 09:36:24 +10:00
0ec02f517e reorder like faustin reviewed, and shellcheck pass 2024-05-17 18:50:03 +10:00
bc74ae649a release 2024 q2 2024-05-17 18:43:07 +10:00
c86ba4c137 do not pass mariadbd arguments with whitespace to mariadb-install-db 2024-05-17 18:40:40 +10:00
58614cbe55 Revert "Workaround issue #560 by removing character-set-collations"
This reverts commit d7a950d41e.
2024-04-16 08:04:19 +10:00
d7a950d41e Workaround issue #560 by removing character-set-collations
This only has an effect on the 11.3 and 11.4 that have the configuration
item set in their configuration file.

The 10.4 instance doesn't have this file.
2024-02-22 12:03:14 +11:00
1d95dfc811 Release 2024 Q1 part 1 2024-02-12 10:03:42 +11:00
f64d0cd117 consistent spacing around docker_sql_escape_string_literal 2024-02-02 13:47:53 +11:00
165acf0da1 Use MARIADB_AUTO_UPGRADE=1 to recreate healthcheck users cnf file missings
Factor our create_healthcheck_users.

Make sure that when recreating users, if they already exist, we just password
reset these and ensure the .my-healtcheck.cnf file is there for usage. We don't
want to clobber any existing grants if we happen not to have MARIADB_HEALTHCHECK_GRANTS
set.

Because creating users needs to move past --skip-grant-tables with FLUSH PRIVEGES,
and mariadb-upgrade also issue FLUSH PRIVILEGES, then unfortunately is yet another
restart.

Adjust test case to ensure there is no .cnf file, and create it on
restore.
2024-02-02 13:47:53 +11:00
2b2461e293 Add memory pressure instrumentation 2023-11-30 08:26:20 +11:00
b1fff513e7 Bump gosu to 1.17
Closes #546.
2023-11-15 10:22:11 +11:00
38b234791e 2023 Q4 part 1 release 2023-11-15 07:43:57 +11:00
6852b71f22 MDEV-32361 iblogfile restore now built into mariadb-backup 2023-10-30 16:37:31 +11:00
a96a1ce6ca entrypoint: my_print_defaults --mysqld in 10.6, 10.10 2023-10-21 10:10:37 +11:00
7022e642a5 Invert single and double quotes for sql command definitions in healtcheck.sh
This way the sql commands are compatible with all sql_modes
When using sql_mode ANSI_QUOTES the healtcheck failed with a query error because in this mode double qutes are interpreted as identifier quote

Resolves #538
2023-10-21 08:45:49 +11:00
4317156600 healthcheck.sh - correct --no-defaults
Thanks @dhaeckel for the bug report and looking
over the solution.

Closes: #539
2023-10-20 23:29:03 +11:00
9614190c05 review fixes for init from backup
As the backup may be from a different configuration requiring
specific parameters, we make the mysql user have a homedir of
/var/lib/mysql and place the backup my.cnf there.

Thanks Faustin for review and Martin for testing.
2023-10-19 10:46:51 +11:00
7a5cf956fa /docker-entrypoint-initdb.d for mariadb-backup
Closes #522
2023-10-19 10:46:51 +11:00
948c16a90e Factor initialzation of empty datadir to docker_mariadb_init 2023-10-19 10:46:51 +11:00
7427ee571b CIS failure due to world-writable directory /var/run/mysqld
While 777 is needed to be writable by multiple users, a sticky
bit will prevent manipulation by other users. Add this to the
permissions of the /run/mysqld directory.

Also correct, in config and filesystem /run/mysqld is used
in every case above 10.4. /var/run is a symlink to /run in the base
OS.

Thanks @ollie1
Closes: #532
2023-10-01 09:27:37 +03:00
1f165423dd Add PROXY priv for root@MARIADB_ROOT_HOST
Thanks Matthieu Gusmini for testing with mariadb-dump --system=users
and helping me find this bug.
2023-09-20 14:26:35 +10:00
1792faf931 healthcheck.sh add --galera_online
For the MariaDB operator that uses this expression.

https://github.com/mariadb-operator/mariadb-operator/blob/v0.0.20/pkg/builder/statefulset_container_builder.go#L357C1-L357C17
2023-09-15 18:31:36 +10:00
73a6fc045e 2023 August release 2023-08-15 07:53:46 +10:00
28adeb9071 REPOSITORY to include debug section by default
This is so someone that wants debug info packages just
needs to apt-get install mariadb-server-core{-10.X}-dbgsym to
get the right packages after and apt-get update.
2023-07-18 09:43:03 +10:00
0999b7e4d6 MDEV-31714: remove mysqld/mariadb_safe.cnf file
The 50-mariadb_safe.cnf file exposed a syslog configuration
that got picked up by Galera SST scripts. These would push
output to /dev/log which doesn't exist in containers.
2023-07-18 09:42:48 +10:00
51c2b915a1 MDEV-31529: MariaDB docker pipeline is failing
s390x database initialization was slow (thanks @tianon).

We don't use it, so fake its existance so debian install scripts
don't consume the intensive part of the installation.

[1] https://github.com/docker-library/official-images/issues/14923
2023-06-23 11:47:07 +10:00
148b0e5d33 Allow healthcheck@{127.0.0.1,::1,localhost} to exist to facilitate healthcheck --connect
healthcheck@{127.0.0.1,::1,localhost} users are granted USAGE by default, which
is enough for the non-replication healthchecks in healtcheck.sh.

The env variable MARIADB_HEALTHCHECK_GRANTS can replace USAGE with any
comma separated set of grants.

On initialization a generated password is created and saved in
$DATADIR/.my-healthcheck.cnf along with the server port and socket. If the
command args or default configuration file changes this may become out
of date. Because the password is generated in configuration file the
'#', comment, and '=' characters cannot be part of this password.

The healthcheck.cnf configuration file also sets protocol=tcp to
enforce indirectly that --connect being a standard part of the test. This is
required as starts of the service under --skip-networking should
never be considered healthy.

The healthcheck script also has the --defaults-extra-file set to this
.my-healthcheck.cnf file, if it exists (backwards compatible on
previously created datadirs), so that all new healthcheck invokations
use the authentication here by default.

The compatibility with old instances, without the .my-healthcheck.cnf is
preserved by non setting --defaults-extra-file.

The healthcheck --connect will increment the server status variable Aborted_connects
for each check, however now connection_error* counts are changed.

This also prevents any invalid password errors showing up in the
container log.

Closes #430
2023-06-21 07:30:58 +10:00
1b4b2584a4 Use SHOW REPLICA[S} STATUS for healthcheck.sh 2023-06-21 07:30:36 +10:00
e56b3a008e 2023 Q2 2 Releases 2023-06-09 17:39:47 +10:00
4c502ce68d 10.3 simplification 2023-05-11 12:11:51 +10:00
b1f92f6f41 shellcheck fixes 2023-05-11 11:01:03 +10:00
7a32d077e4 Q2 2023 releases 2023-05-11 09:39:47 +10:00
98c792140d MDEV-29762: Add capability for replication
These are controled by:
* MARIADB_MASTER_HOST - if specified, the master, and the container is a replica
* MARIADB_REPLICATION_PORT - port number
* MARIADB_REPLICATION_USER - create or use this user
* MARIADB_REPLICATION_PASSWORD - create or use this password
* MARIADB_REPLICATION_PASSWORD_HASH (on master only)

If MARIADB_MASTER_HOST isn't specified, the container is a master. In
this case, the MARIADB_REPLICATION_USER is created, with password{,hash},
and given the REPLICATION REPLICA grant, or REPLICATION SLAVE (for
10.3, 10.4).

If the MARIADB_MASTER_HOST is specified, CHANGE MASTER TO is used to
connect to the MARIADB_MASTER_HOST:MARIADB_MASTER_PORT(default 3306)
using the MARIADB_REPLICATION_USER. As the password is needed
MARIADB_REPLICATION_PASSWORD_HASH cannot be used on a replica.
CHANGE MASTER TO is executed with MASTER_CONNECT_RETRY=10 and the
replica is started by default.

The creation of the replication user is replicated along with the
master's /docker-entrypoint-initdb.d/ contents and MARIADB_DATABASE
/MARIADB_USER. The MARIADB_MYSQL_LOCALHOST_USER isn't replicated and
neither is the timezone data.

Signed-off-by: MdSahil-oss <Mohdssahil1@gmail.com>
Reviewed-by: Daniel Black <daniel@mariadb.org>
2023-05-09 09:21:37 +10:00
ab852935f3 Merge branch 'master' into lts 2023-05-08 12:02:40 +10:00