Bug 279362 - databases/mariadb1011-server 10.11.8 Hangs Indefinitely on Restart with Warning in Error Log
Summary: databases/mariadb1011-server 10.11.8 Hangs Indefinitely on Restart with Warni...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Bernard Spil
URL: https://jira.mariadb.org/browse/MDEV-...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-28 12:02 UTC by Alex Hemp
Modified: 2024-06-16 17:15 UTC (History)
8 users (show)

See Also:
bugzilla: maintainer-feedback? (brnrd)


Attachments
git diff for databases/mariadb1011-server (5.20 KB, patch)
2024-05-30 10:12 UTC, Bernard Spil
no flags Details | Diff
git diff for databases/mariadb1011-server (3.91 KB, patch)
2024-06-16 08:44 UTC, Bernard Spil
brnrd: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Hemp 2024-05-28 12:02:40 UTC
MariaDB 10.11.8 from ports, with all options off except INNOBASE and GSSAPI_NONE, hangs indefinitely on restart (service mysql restart). The following warning appears in the error log:

> [Warning] Signal handler thread did not exit in a timely manner. Continuing to wait for it to stop..

This issue does not occur in version 10.11.7, which works fine under the same conditions.

Steps to Reproduce:
- Install MariaDB 10.11.8 from ports with all options off except INNOBASE and GSSAPI_NONE.
- Start the MariaDB service.
- Restart the MariaDB service using service mysql restart.

FreeBSD version 13.2-RELEASE-p11 amd64
Comment 1 Raúl 2024-05-28 12:48:37 UTC
(In reply to Alex Hemp from comment #0)

Same happens here running on FreeBSD 14.1-RC1 amd64.

[....]
2024-05-27 23:24:23 0 [Note] /usr/local/libexec/mariadbd (initiated by: unknown): Normal shutdown
2024-05-27 23:24:34 0 [Warning] Signal handler thread did not exit in a timely manner. Continuing to wait for it to stop..
[....]
Comment 2 Alex Hemp 2024-05-28 14:30:10 UTC
forget to mention - i'm using zfs on single machine so have disabled binlog and doublewrite

rc.conf
> mysql_args="--socket=/var/run/mysql/mysql.sock \
>            --skip-name-resolve \
>            --disable-log-bin \
>            --skip-innodb-doublewrite \
>            --innodb-undo-log-truncate=1 \
>            --innodb-use-atomic-writes=0 \
>            --innodb-flush-method=O_DSYNC \
>            --innodb-flush-neighbors=0 \
>            --innodb-flush-log-at-trx-commit=2 \
>            --transaction-isolation=READ-COMMITTED \
>            --sql-mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,TIME_ROUND_FRACTIONAL \
>            --log-error=/var/log/mysql/error.log \
>            --collation-server=utf8_general_ci --character-set-server=utf8 
"
Comment 3 Marek 2024-05-29 06:06:40 UTC
Hi,

Same here. If trying to stop or restart MariaDB it tooks forever.
As a workaround, to proper database shutdown, don't use `rc.d' start/stop script, just use ``mariadb-admin'' command like:

# mariadb-admin -u root -pPASS shutdown

MariaDB version: 10.6.18 installed from ports tree.
FreeBSD version: 14.0-RELEASE running on Hyper-V VM Gen2.
Comment 4 Bernard Spil freebsd_committer freebsd_triage 2024-05-29 06:57:17 UTC
Can you please log an upstream ticket? Nothing changed in the port.

https://jira.mariadb.org
Comment 5 Alex Hemp 2024-05-29 07:02:13 UTC
Upstream bug https://jira.mariadb.org/browse/MDEV-34254
Comment 6 Bernard Spil freebsd_committer freebsd_triage 2024-05-29 08:33:51 UTC
Looks like a "known issue" upstream?

I've got the 11.4 port lined up, but it's not in ports yet as it's a release candidate still.

Download https://brnrd.eu/bsd/mariadb114.tar.gz contains drop-in directories for your `PORTSDIR` and a patch-ports git diff to wire it into your tree.
Comment 7 Eero Hänninen 2024-05-29 13:35:20 UTC
Can confirm that mariadb 11.4.1 does not have this issue.
Comment 8 Bernard Spil freebsd_committer freebsd_triage 2024-05-30 10:07:19 UTC
Preparing a patch based on https://jira.mariadb.org/browse/MDEV-34254 feedback. See https://github.com/MariaDB/server/pull/3253

Apparently is also an issue on MacOS.
Comment 9 Bernard Spil freebsd_committer freebsd_triage 2024-05-30 10:12:03 UTC
Created attachment 251082 [details]
git diff for databases/mariadb1011-server

from https://github.com/MariaDB/server/pull/3253
Comment 10 DutchBSD 2024-06-06 17:50:35 UTC
has anyone already tested the patch?
Comment 11 Udo Schweigert 2024-06-08 10:35:56 UTC
I tested the patch here on 13-3, 13-stable and 14.1. It works without a problem, means the db itself of course and also stoping from the rc-script.
Comment 12 DutchBSD 2024-06-11 04:40:40 UTC
(In reply to Bernard Spil from comment #6)

Can confirm that mariadb 11.4.1 did work for me too.

I have upgraded your port to 11.4.2 today than in files 
patch-mysys_crc32_crc32c.cc can be deleted.

11.4.2 is stable released and is no longer a RC.

Regards
Comment 13 fullermd 2024-06-12 23:03:59 UTC
Works for me on mariadb1011-server on 14.1-ish stable/14.
Comment 14 Bernard Spil freebsd_committer freebsd_triage 2024-06-16 08:44:56 UTC
Created attachment 251494 [details]
git diff for databases/mariadb1011-server

redid the patch based on a git diff of the sql/mysqld.cc file.

Please test and respond back on outcome!
Comment 15 Michael Grimm 2024-06-16 09:34:09 UTC
(In reply to Bernard Spil from comment #14)
Works fine and doesn't hang anymore on shutdown.

Thanks.
Comment 16 Raúl 2024-06-16 09:36:54 UTC
(In reply to Bernard Spil from comment #14)

Also works here, thanks!
Comment 17 Udo Schweigert 2024-06-16 10:59:10 UTC
Works for my setup too.
Comment 18 commit-hook freebsd_committer freebsd_triage 2024-06-16 11:34:07 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=06c03bcd2f1a0a88cc1a5e8cb1a39a1327bad62d

commit 06c03bcd2f1a0a88cc1a5e8cb1a39a1327bad62d
Author:     Bernard Spil <brnrd@FreeBSD.org>
AuthorDate: 2024-06-16 11:32:13 +0000
Commit:     Bernard Spil <brnrd@FreeBSD.org>
CommitDate: 2024-06-16 11:32:13 +0000

    databases/mariadb1011-server: Fix Hangs Indefinitely

    PR:             279362
    Obtained from:  https://jira.mariadb.org/browse/MDEV-34254

 databases/mariadb1011-server/Makefile              |  1 +
 .../mariadb1011-server/files/patch-PR279362 (new)  | 85 ++++++++++++++++++++++
 2 files changed, 86 insertions(+)
Comment 19 Bernard Spil freebsd_committer freebsd_triage 2024-06-16 11:36:46 UTC
Thanks everyone for the feedback. Took me longer than anticipated, the whole merging stuff in MariaDB (10.5 -> 10.6 -> 10.11) makes things pretty murky.
Comment 20 Bernard Spil freebsd_committer freebsd_triage 2024-06-16 14:24:46 UTC
FYI: Just committed MariaDB 11.4.2 to ports.

https://cgit.freebsd.org/ports/tree/databases/mariadb114-server
Comment 21 Michael Grimm 2024-06-16 16:58:11 UTC
(In reply to Bernard Spil from comment #20)

FYI: I did UNSET all options except INNOBASE and GSSAPI_NONE.

The compilation fails with:

===>  Building packages for mariadb114-server-11.4.2
===>   Building mariadb114-server-11.4.2
pkg-static: Unable to access file /wrkdirs/usr/ports/databases/mariadb114-server/work/stage/usr/local/share/man/man1/galera_new_cluster.1.gz:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/databases/mariadb114-server/work/stage/usr/local/share/man/man1/galera_recovery.1.gz:No such file or directory
*** Error code 1

The following patch fixes that:

MWNt> diff -u pkg-plist pkg-plist.unpatched 
--- pkg-plist	2024-06-16 18:42:21.628454000 +0200
+++ pkg-plist.unpatched	2024-06-16 18:42:06.965259000 +0200
@@ -227,8 +227,8 @@
 share/man/man1/aria_ftdump.1.gz
 share/man/man1/aria_pack.1.gz
 share/man/man1/aria_read_log.1.gz
-%%WSREP%%share/man/man1/galera_new_cluster.1.gz
-%%WSREP%%share/man/man1/galera_recovery.1.gz
+share/man/man1/galera_new_cluster.1.gz
+share/man/man1/galera_recovery.1.gz
 share/man/man1/innochecksum.1.gz
 share/man/man1/mariabackup.1.gz
 share/man/man1/mariadb-backup.1.gz


BUT: I do *not* know if this is nonsense, especially since pkg-plist of mariadb1011-server doesn't have these additions, but compiles perfectly well without.

HTH
Comment 22 Michael Grimm 2024-06-16 16:59:51 UTC
(In reply to Michael Grimm from comment #21)

Sorry, here is the correct patch:

mer-waases|root> diff -u pkg-plist.unpatched  pkg-plist
--- pkg-plist.unpatched	2024-06-16 18:42:06.965259000 +0200
+++ pkg-plist	2024-06-16 18:50:03.253013000 +0200
@@ -227,8 +227,8 @@
 share/man/man1/aria_ftdump.1.gz
 share/man/man1/aria_pack.1.gz
 share/man/man1/aria_read_log.1.gz
-share/man/man1/galera_new_cluster.1.gz
-share/man/man1/galera_recovery.1.gz
+%%WSREP%%share/man/man1/galera_new_cluster.1.gz
+%%WSREP%%share/man/man1/galera_recovery.1.gz
 share/man/man1/innochecksum.1.gz
 share/man/man1/mariabackup.1.gz
 share/man/man1/mariadb-backup.1.gz
Comment 23 commit-hook freebsd_committer freebsd_triage 2024-06-16 17:15:19 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9f97021574ac4b7d1ee5641fd58c5e4fa551a9bc

commit 9f97021574ac4b7d1ee5641fd58c5e4fa551a9bc
Author:     Bernard Spil <brnrd@FreeBSD.org>
AuthorDate: 2024-06-16 17:11:31 +0000
Commit:     Bernard Spil <brnrd@FreeBSD.org>
CommitDate: 2024-06-16 17:11:31 +0000

    databases/mariadb106-server: Fix hang on restart

    PR:             279362
    Obtained from:  https://jira.mariadb.org/browse/MDEV-34254

 databases/mariadb106-server/Makefile               |  2 +-
 .../mariadb106-server/files/patch-MDEV-34254 (new) | 52 ++++++++++++++++++++++
 2 files changed, 53 insertions(+), 1 deletion(-)