mysqld_safe --wsrep_recover not working properly
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL patches by Codership |
Invalid
|
Undecided
|
Unassigned | |||
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC | Status tracked in 5.6 | |||||
5.5 |
Confirmed
|
Undecided
|
Unassigned | |||
5.6 |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
This is 5.6.15:
I cannot get --wsrep-recover to work properly:
[root@node3 ~]# mysqld_safe --wsrep-recover
140107 16:09:56 mysqld_safe Logging to '/var/lib/
140107 16:09:56 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140107 16:09:56 mysqld_safe Skipping wsrep-recover for 7206c8e4-
140107 16:09:56 mysqld_safe Assigning 7206c8e4-
140107 16:09:58 mysqld_safe mysqld from pid file /var/lib/
^^ This is pulling from the grastate.dat, so no actual recovery is done here. I kind of think wsrep_recover should always get the recovered position (regardless of the grastate.dat), at least this is how it worked before.
If I remove the grastate.dat, I get this instead:
[root@node3 ~]# mysqld_safe --wsrep-recover
140107 16:05:24 mysqld_safe Logging to '/var/lib/
140107 16:05:24 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140107 16:05:24 mysqld_safe Skipping wsrep-recover for empty datadir: /var/lib/mysql
140107 16:05:24 mysqld_safe Assigning 00000000-
140107 16:05:26 mysqld_safe mysqld from pid file /var/lib/
[root@node3 ~]# ls /var/lib/mysql/
auto.cnf GRA_4_237147.log innobackup.
backup-my.cnf GRA_5_237146.log mysql xtrabackup_binary
error.log GRA_5_4.log mysql.sock xtrabackup_
galera.cache ibdata1 performance_schema xtrabackup_
GRA_1_237148.log ib_logfile0 RPM_UPGRADE_HISTORY xtrabackup_
GRA_3_237145.log ib_logfile1 RPM_UPGRADE_
So in this case a grastate.dat must be present to do a recovery, which is non-obvious.
I found if I have a non-parseable or zeroed grastate will --wsrep_recover actually pull the GTID from Innodb.
@Jay,
In an older bug (for 5.5), it was decided to skip wsrep-recover position. So, what you are observing is what was
when its results were not going to be used (ie. not going to be
used by galera), instead get them directly from grastate.dat to
wsrep-start-
implemented then.
In addition, do you want wsrep-recover to run forced when
--wsrep_recover is provided to mysqld_safe? If so, that can be
done. That was not considered since wsrep_recover is run
automatically usually.
For now, to force recover without removing grastate.dat, you can
set seqno to -1 in grastate.dat and then start. (but this may
have other side effects).