Example wsrep_notify script fails on node shutdown

Bug #1132955 reported by Alex Yurchenko on 2013-02-25
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL patches by Codership
Status tracked in 5.6
5.5
Medium
Yan Zhang
5.6
Medium
Yan Zhang
Percona XtraDB Cluster
Status tracked in 5.6
5.5
Undecided
Unassigned
5.6
Undecided
Unassigned

Bug Description

Due to empty member list supplied:

/usr/share/mysql/wsrep_notify: line 88: $2: unbound variable
130225 9:49:43 [ERROR] WSREP: Process completed with error: /usr/share/mysql/wsrep_notify --status Undefined --uuid 1a8aaf53-658f-11e2-0800-4dd9205307af --primary no --index -1 --members: 1 (Operation not permitted)

line 88:
        MEMBERS=$2

Changed in codership-mysql:
milestone: 5.5.30-24.8 → 5.5.31-23.7.4
Changed in percona-xtradb-cluster:
milestone: none → 5.5.31-25
Changed in codership-mysql:
milestone: 5.5.31-23.7.5 → 5.5.32-23.7.6

Is there any context where the member list can be empty?

From wsrep_notify.cc:
=========
    for (int i = 0; i < view->memb_num; i++)
    {
      wsrep_uuid_print (&view->members[i].id, uuid_str, sizeof(uuid_str));
      cmd_off += snprintf (cmd_ptr + cmd_off, cmd_len - cmd_off,
                           "%c%s/%s/%s", i > 0 ? ',' : ' ',
                           uuid_str, view->members[i].name,
                           view->members[i].incoming);
    }

=========

Is the self (the node on where this runs) not part of view (ie.
view->my_idx being one of view->memb_num)? If not, is this a bug?

Changed in percona-xtradb-cluster:
milestone: 5.5.33-23.7.6 → future-5.5
Changed in codership-mysql:
milestone: 5.5.33-23.7.6 → 5.5.34-24.9
Changed in codership-mysql:
milestone: 5.5.34-25.9 → 5.5.34-25.10
Daniel Black (daniel-black) wrote :

This occurs when the mysqld instantance is shutdown. I'm assuming the members are removed before the second calling.

Mar 13 05:39:06 db1 galera_notify: run with: --status Undefined --uuid d30213b2-a989-11e3-ab45-674672f482d1 --primary no --index 0 --members b8810e6f-aa62-11e3-b79c-279691a06c78/db1/106.186.114.215:3306
Mar 13 05:39:06 db1 galera_notify: run with: --status Undefined --uuid d30213b2-a989-11e3-ab45-674672f482d1 --primary no --index -1 --members

Daniel Black (daniel-black) wrote :

really easy patch to fix this attached

tags: added: patch
Alex Yurchenko (ayurchen) wrote :

Yan, I think that fix is in the wrong place. wsrep_notify.sh is just an example script. Fixing it does not fix the problem that anybody who writes his own script will face - namely the dangling --members option. It simply should not be there.

Nirbhay Choubey (nirbhay) wrote :

The 2nd patch left behind an unmatched "fi" (syntax error) in the example script.

http://bazaar.launchpad.net/~codership/codership-mysql/wsrep-5.5/revision/3974#support-files/wsrep_notify.sh

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

Other bug subscribers