Don't run wsrep-recover on first SST

Bug #1191767 reported by Raghavendra D Prabhu on 2013-06-17
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to
Fix Released
Raghavendra D Prabhu

Bug Description

This adds a needless step: wsrep-recover creates ibdata1 and ib_logfile* files and the SST after that removes them - (which is slow and unnecessary)

The logic is that if datadir is empty, use "00000000-0000-0000-0000-000000000000:-1" directly.

Related branches

Changed in percona-xtradb-cluster:
milestone: none → 5.5.31-25
assignee: nobody → Raghavendra D Prabhu (raghavendra-prabhu)
description: updated

Actually fix for this is needed in this milestone, otherwise it breaks SST. So, fixed it.

It broke SST only when xbstream is used, otherwise it didn't.

Changed in percona-xtradb-cluster:
milestone: 5.5.31-25 → 5.5.31-23.7.5
status: New → Fix Released
Jay Janssen (jay-janssen) wrote :

Actually, when I break it down, wsrep_recover's position (submitted via --wsrep_start_position) is *only* used when the grastate looks like this:

uuid:    9d241cd3-c46c-11e2-0800-81ab1e4b64e6
seqno:   -1

Why don't we make mysqld_safe check for this state (non-zero uuid and -1 seqno) before it decides to bother with wsrep_recover?

I would also submit that wsrep_recover should be tried when the grastate is simply missing, but galera won't auto-generate a grastate from only --wsrep_start_position yet (

Jay Janssen (jay-janssen) wrote :

Expounding on the above: --wsrep_start_position does not seem to apply when:

- uuid + seqno are set (and non-zero / -1)
- grastate is zeroed
- grastate is missing

Therefore, there is no point in running wsrep_recover automatically in those states.


Yes, I will check into that. In this issue I was looking at only the empty datadir SST issue (and it was also breaking SST + xbstream + mysqld_safe). Hence, fixed this for this milestone itself. For the other cases, I will open a separate issue.

Regarding #4,

> - grastate is missing

This is the logic I am currently using to avoid wsrep-recover for
SST on empty directory. for details.

Alex Yurchenko (ayurchen) wrote :

Just some food for thought: strictly speaking the user can configure grastate.dat file to be called differently and to be stored in a location different from mysql datadir. In fact, when we start to support multiple providers this will become a necessity. So ideally we must think of something better than checking a fixed file name.


Do you mean the wsrep_data_home_dir (for grastate.dat's location)? I will add it in lp:1193781.

Does the name of the file change? Currently it looks statically
set. If it is changed in future, I will change it in mysqld_safe

Alex Yurchenko (ayurchen) wrote :

Yes, perhaps taking care of the wsrep_data_home_dir could be sufficient. But unchanged file name can't be guaranteed in future...

Percona now uses JIRA for bug reports so this bug report is migrated to:

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers