server
server copied to clipboard
MDEV-34902: Fix Debian reporting error on Aria/MyISAM even tables are…
- [x] The Jira issue number for this PR is: MDEV-34902
Description
Commit changes ''' to single back-tick char in Debian start-up script function 'check_for_crashed_tables' which is used to check are Aria/MyISAM tables crashed and do they need manual repairing.
Without this initial script can report for crashed tables even if they are all good.
Release Notes
Should not add anything
How can this PR be tested?
This is bit tricky to test (automatic test is on it's was but still in works). This bit WIP currently If you have podman with systemd:
podman run -it --systemd=true registry.salsa.debian.org/salsa-ci-team/pipeline/autopkgtest systemd
and then
podman exec -it correctsha bash
one can install system MariaDB with these: https://mariadb.org/download/?t=repo-config&d=Debian+%22Sid%22&v=10.11&r_m=xtom_tal After that should install nano
apt install nano
and then run add this script:
#!/bin/bash
function check_journalctl
{
JOURNALCTL_ERROR=$(journalctl | grep "\[ERROR\] mariadbd: Table './mydatabase/mytable name' is marked as crashed and should be repaired")
if [ -z "${JOURNALCTL_ERROR}" ]
then
echo "There should be error that MyISAM crashed and it's repaired"
exit 1
fi
JOURNALCTL_ERROR=$(journalctl | grep "\[Warning\] Checking table: './mydatabase/mytable name'")
if [ -z "${JOURNALCTL_ERROR}" ]
then
echo "There should be warning for MyISAM check"
exit 1
fi
}
set -ex
systemctl restart mariadb
echo '
DROP DATABASE IF EXISTS mydatabase;
CREATE DATABASE IF NOT EXISTS mydatabase;
USE mydatabase;
CREATE TABLE `mytable-dev` (id INT(11), name VARCHAR(100)) ENGINE=Aria;
INSERT INTO `mytable-dev` (id, name) VALUES (1, "John Doe");
CREATE TABLE `mytable name` (id INT(11), name VARCHAR(100)) ENGINE=Aria;
INSERT INTO `mytable name` (id, name) VALUES (1, "John Doe");
CREATE TABLE `mytable-dev` (id INT(11), name VARCHAR(100)) ENGINE=MyISAM;
INSERT INTO `mytable-dev` (id, name) VALUES (1, "John Doe");
CREATE TABLE `mytable name` (id INT(11), name VARCHAR(100)) ENGINE=MyISAM;
INSERT INTO `mytable name` (id, name) VALUES (1, "John Doe");
' | mariadb
killall -9 mariadbd
sleep 3s
check_journalctl
#
# Remove journal
journalctl --flush --rotate --vacuum-time=1s
sleep 3s
systemctl restart mariadb
check_journalctl
exit 0
It should fail even without killall -9 mariadb every time. After that tester should download deb packages from https://salsa.debian.org/illuusio/mariadb-server/-/pipelines/740935 and install them with
apt install debian/output/*.deb
and run script again and it should not complain all the times in journalctl. I'll update this testing..
Basing the PR against the correct MariaDB version
- [x] This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.
PR quality check
- [x] I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
- [x] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.