maria-discuss team mailing list archive
-
maria-discuss team
-
Mailing list archive
-
Message #01787
race conditions after SIGTERM
-
To:
Mailing-List mariadb <"maria-discuss"@lists.launchpad.net>
-
From:
Reindl Harald <h.reindl@xxxxxxxxxxxxx>
-
Date:
Thu, 24 Jul 2014 12:42:51 +0200
-
Openpgp:
id=7F780279; url=http://arrakis.thelounge.net/gpg/h.reindl_thelounge.net.pub.txt
-
Organization:
the lounge interactive design
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0
how can that script lead to a race condition where files
are not fully written to disk? that never happens if the
systemd-unit for the replication instance has
"ExecStopPost=/usr/bin/sleep 1" and waits a while
my only explaination is that mysqld returns after the SIGTERM
from systemd before all data are completly written in some racy
situations and so rsynced incompletly to the datadir of the
other instance
_________________________________________________________
#!/bin/bash
systemctl stop replication.service
systemctl stop mysqld.service
rsync $RSYNC_PARAMS /mysql_replication/ /mysql_data/
systemctl start replication.service
systemctl start mysqld.service
_________________________________________________________
[Unit]
Description=MariaDB Replication
[Service]
Type=simple
PIDFile=/run/mysqld/mysqld_replication.pid
ExecStart=/usr/libexec/mysqld --defaults-file=/etc/my-replication.cnf --pid-file=/run/mysqld/mysqld_replication.pid
--socket=/var/lib/mysql/mysql_replication.sock --open-files-limit=30000 --basedir=/usr --user=mysql
Environment="LANG=en_GB.UTF-8"
Restart=always
RestartSec=1
_________________________________________________________
140724 12:22:59 [Note] /usr/libexec/mysqld: Shutdown complete
140724 12:23:01 [Note] Plugin 'InnoDB' is disabled.
Cannot find checkpoint record at LSN (1,0x35767)
140724 12:23:01 [ERROR] mysqld: Aria recovery failed. Please run aria_chk -r on all Aria tables and delete all
aria_log.######## files
140724 12:23:01 [ERROR] Plugin 'Aria' init function returned error.
140724 12:23:01 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
140724 12:23:01 [Note] Plugin 'FEDERATED' is disabled.
140724 12:23:01 [Note] Plugin 'FEEDBACK' is disabled.
140724 12:23:01 [ERROR] Aria engine is not enabled or did not start. The Aria engine must be enabled to continue as
mysqld was configured with --with-aria-tmp-tables
140724 12:23:01 [ERROR] Aborting
140724 12:23:01 [Note] /usr/libexec/mysqld: Shutdown complete
140724 12:23:03 [Note] Plugin 'InnoDB' is disabled.
Cannot find checkpoint record at LSN (1,0x35767)
Attachment:
signature.asc
Description: OpenPGP digital signature