MySQL OCF RA monitor to not race with SST in progress
When an SST's in progress, xtrabackup-v2 removes /var/lib/mysql/
ibdata1 and ib_logfiles. That is must be done for the innobackupex to
finish its job.
When action monitor invokes the update_node_gtid(), which calls the
/usr/bin/mysqld_safe --wsrep-recover, it creates those files back.
This may race with active SST and fails it.
Fix the check_if_sst() to verify both the sst_in_progress file presense AND
the ibdata1 file absence. Do not invoke update_node_gtid when there is an
active SST found.
NOTE: the SST check may not rely only on the sst_in_progress file. When
mysqld is starting, it creates its pidfile few moments later. But there's
likely an SST's in progress already. This makes the OCF RA thinking that
MySQL isn't running, thus removing the sst_in_progress file as
a stale artifact. So it cannot reliably distinguish either mysqld has died
in the middle of SST or it is yet to be started and is syncing. So, the
ibdata1 file makes the check more reliable.
Reviewed: https:/ /review. openstack. org/311108 /git.openstack. org/cgit/ openstack/ fuel-library/ commit/ ?id=9442e58b945 c073342e1f1410c 09577df56c6e1f
Committed: https:/
Submitter: Jenkins
Branch: master
commit 9442e58b945c073 342e1f1410c0957 7df56c6e1f
Author: Bogdan Dobrelya <email address hidden>
Date: Fri Apr 29 14:58:35 2016 +0200
MySQL OCF RA monitor to not race with SST in progress
When an SST's in progress, xtrabackup-v2 removes /var/lib/mysql/ bin/mysqld_ safe --wsrep-recover, it creates those files back.
ibdata1 and ib_logfiles. That is must be done for the innobackupex to
finish its job.
When action monitor invokes the update_node_gtid(), which calls the
/usr/
This may race with active SST and fails it.
Fix the check_if_sst() to verify both the sst_in_progress file presense AND
the ibdata1 file absence. Do not invoke update_node_gtid when there is an
active SST found.
NOTE: the SST check may not rely only on the sst_in_progress file. When
mysqld is starting, it creates its pidfile few moments later. But there's
likely an SST's in progress already. This makes the OCF RA thinking that
MySQL isn't running, thus removing the sst_in_progress file as
a stale artifact. So it cannot reliably distinguish either mysqld has died
in the middle of SST or it is yet to be started and is syncing. So, the
ibdata1 file makes the check more reliable.
Closes-bug: #1576073
Change-Id: I427c0486020344 1f8f2f0d0b54375 ec4ff2b3c3e
Signed-off-by: Bogdan Dobrelya <email address hidden>