HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

grastate.dat with seqno -1 on a healthy cluster. Why?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
whyseqnowithhealthygrastatedatcluster

Problem

We use those versions:

# rpm -qa | egrep '(galera|maria)'
mariadb-libs-5.5.41-2.el7_0.x86_64
mariadb-galera-common-5.5.40-6.el7ost.x86_64
mariadb-galera-server-5.5.40-6.el7ost.x86_64
mariadb-5.5.41-2.el7_0.x86_64
galera-25.3.5-6.el7ost.x86_64


that's our grastate.dat

# cat /var/lib/mysql/data/grastate.dat
# GALERA saved state
version: 2.1
uuid:    e7ead849-f2a3-11e4-bfda-7f651f709ee3
seqno:   -1
cert_index:


The seqno: -1 looks fishy. On other clusters there is a number. I don't know why. According to docs this seems "crashed". The -1 is after outage. But this cluster is healthy.

modify time is long ago

# stat /var/lib/mysql/data/grastate.dat
  File: â/var/lib/mysql/data/grastate.datâ
  Size: 104             Blocks: 8          IO Block: 4096   regular file
Device: fd09h/64777d    Inode: 108         Links: 1
Access: (0660/-rw-rw----)  Uid: ( 1000/   mysql)   Gid: ( 1000/   mysql)
Context: system_u:object_r:mysqld_db_t:s0
Access: 2015-07-29 14:51:25.170699518 +0200
Modify: 2015-06-02 11:50:21.564360655 +0200
Change: 2015-06-02 11:50:21.564360655 +0200
 Birth: -


from logs (no errors only info and warnings):

```
150504 23:24:11 [Note] WSREP: gcomm: connected
150504 23:24:11 [Note] WSREP: Changing maximum packet size to 64500, resulting msg size: 32636
150504 23:24:11 [Note] WSREP: Shifting CLOSED -> OPEN (TO: 0)
150504 23:24:11 [Note] WSREP: Opened channel 'galera_cluster'
150504 23:24:11 [Note] WSREP: New COMPONENT: primary = yes, bootstrap = no, my_idx = 0, memb_num = 1
150504 23:24:11 [Note] WSREP: Waiting for SST to complete.
150504 23:24:11 [Note] WSREP: Starting new group from scratch: e7ead849-f2a3-11e4-bfda-7f651f709ee3
150504 23:24:11 [Note] WSREP: STATE_EXCHANGE: sent state UUID: e7eae37d-f2a3-11e4-a76e-6e8297197928
150504 23:24:11 [Note] WSREP: STATE EXCHANGE: sent state msg: e7eae37d-f2a3-11e4-a76e-6e8297197928
150504 23:24:11 [Note] WSREP: STATE EXCHANGE: got state msg: e7eae37d-f2a3-11e4-a76e-6e8297197928 from 0 (hostname

Solution

A grastate.dat with a sequence number of -1 is fine on a running node.

When the cluster stops cleanly, the sequence number will be set to a value on each node. You'll then have to bootstrap the cluster from the node which has the most advanced seqno.

Context

StackExchange Database Administrators Q#108437, answer score: 4

Revisions (0)

No revisions yet.