Don't run wsrep-recover on first SST

Bug #1191767 reported by Raghavendra D Prabhu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Fix Released
Undecided
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
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

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

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

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
Revision history for this message
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 (https://bugs.launchpad.net/galera/+bug/1112724).

Revision history for this message
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.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

@Jay,

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.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

Regarding #4,

> - grastate is missing

This is the logic I am currently using to avoid wsrep-recover for
SST on empty directory. https://bazaar.launchpad.net/~raghavendra-prabhu/percona-xtradb-cluster/release-5.5.31/revision/433 for details.

Revision history for this message
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.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

@Alexey,

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
then.

Revision history for this message
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...

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-1377

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.