Setting wsrep_on=0 in my.cnf/cmdline is not respected

Bug #1039121 reported by Alex Yurchenko
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL patches by Codership
New
Undecided
Unassigned
5.5
New
Undecided
Unassigned
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Won't Fix
Undecided
Unassigned
5.5
Won't Fix
Undecided
Unassigned
5.6
Won't Fix
Undecided
Unassigned

Bug Description

This may lead to undesirable effects when trying to start mysqld with replication disabled

Changed in codership-mysql:
importance: Undecided → Medium
milestone: none → 5.5.27-23.7
status: New → Confirmed
Changed in codership-mysql:
milestone: 5.5.28-23.7 → 5.5.28-23.8
Changed in codership-mysql:
milestone: 5.5.30-24.8 → 5.5.31-23.7.4
Changed in codership-mysql:
milestone: 5.5.31-23.7.5 → 5.5.32-23.7.6
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
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

This is not applicable not just for my.cnf but also for
commandline.

ie. mysqld --user=mysql --wsrep-on=OFF doesn't work.

This is important because documentation states that this is the
only way to ensure galera replication doesn't start which is
currently not the case.

The only way, currently is mysqld --user=mysql --wsrep-provider='none'

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

Also, not just 5.5, but 5.6 is affected too.

summary: - Setting wsrep_on=0 in my.cnf is not respected
+ Setting wsrep_on=0 in my.cnf/cmdline is not respected
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

wsrep_on value conflicts with provider:

  if (strlen(wsrep_provider)== 0 ||
      !strcmp(wsrep_provider, WSREP_NONE))
  {
    // enable normal operation in case no provider is specified
    wsrep_ready_set(TRUE);
    global_system_variables.wsrep_on = 0;
    return 0;
  }

ie. with galera provider and wsrep_on=0 it may not work
correctly (I even got a crash while testing), while with the none provider it may. So, it may be better to keep wsrep_on a runtime session variable and not have it as a command line one. Updating docs for now.

Changed in codership-mysql:
status: Confirmed → New
importance: Medium → Undecided
milestone: 5.5.37-25.10 → none
Revision history for this message
Nilnandan Joshi (nilnandan-joshi) wrote :
Download full text (3.6 KiB)

Verified with PXC 5.5 and PXC 5.6. wsrep-on=OFF is not working either set in my.cnf or command-line.

With PXC 5.5:

[root@percona-pxc55-1 ~]# ps -ef | grep mysql
mysql 2855 964 1 14:59 pts/0 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --wsrep-new-cluster --log-error=/var/lib/mysql/error.log --pid-file=/var/lib/mysql/percona-pxc55-1.pid --wsrep_start_position=eb3828f9-2125-11e4-b71b-3ff545ea7ce6:10 --wsrep-on=OFF
root 2881 2837 0 14:59 pts/1 00:00:00 grep mysql
[root@percona-pxc55-1 ~]#
[root@percona-pxc55-1 ~]#
[root@percona-pxc55-1 ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.37-35.0-55-log Percona XtraDB Cluster (GPL), Release rel35.0, Revision 756, WSREP version 25.10, wsrep_25.10.r3985

Copyright (c) 2009-2014 Percona LLC and/or its affiliates
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show global variables like 'wsrep_on';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wsrep_on | ON |
+---------------+-------+
1 row in set (0.00 sec)

mysql> quit
Bye
[root@percona-pxc55-1 ~]# cat /etc/my.cnf | grep "wsrep_on"
wsrep_on=OFF
[root@percona-pxc55-1 ~]#

-------------------------------------------------------
With PXC 5.6:
-------------------------------------------------------

root@debian:~# ps -ef | grep mysql
mysql 5629 4714 3 15:03 pts/3 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --wsrep-provider=/usr/lib/libgalera_smm.so --wsrep-new-cluster --log-error=/var/lib/mysql/debian.err --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306 --wsrep_start_position=3671fad1-123e-11e4-8ee5-7febff796263:41 --wsrep-on=OFF
root 5660 4714 0 15:03 pts/3 00:00:00 grep mysql
root@debian:~#
root@debian:~#
root@debian:~# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.19-67.0-56-log Percona XtraDB Cluster (GPL), Release 25.6, wsrep_25.6.r4111

Copyright (c) 2009-2014 Percona LLC and/or its affiliates
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show global variables like 'wsrep_on';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wsrep_on | ON |
+---------------+-------+
1 row in set (0.01 sec)

mysql> quit
Bye
root@debian:~# cat /etc/mysql/my.cnf | grep "wsrep_on"
wsrep_on=OFF
root@debian:~#

BUT, if we are setting it with SET GLOBAL then it works.

mysql> show ...

Read more...

Revision history for this message
Nilnandan Joshi (nilnandan-joshi) wrote :

With SET GLOBAL ,it works.

mysql> show global variables like 'wsrep_on';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wsrep_on | ON |
+---------------+-------+
1 row in set (0.00 sec)

mysql> SET GLOBAL wsrep_on = OFF;
Query OK, 0 rows affected (0.00 sec)

mysql> show global variables like 'wsrep_on';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wsrep_on | OFF |
+---------------+-------+
1 row in set (0.00 sec)

Even I have tested, it will not replicate.

Revision history for this message
Krunal Bauskar (krunal-bauskar) wrote :

- Behavior with 5.6 latest trunk

1. Start node-1,2
2. node-1: create t1, insert (1)
3. node-2: able to see t1 with 1
4. node-1: set wsrep_on = 0 (Note: this is session only variable)
5. node-1: insert (10)
6. node-2: can't see the insert(10)
7. node-2: insert (100).
8. node-1: can see 100 inserted. [Note: applier thread still has wsrep_on = true being a session only variable]
9. node-1: set wsrep_on = 1
10. node-1: insert (20)
11. node-2: got insert (20)

So things are working fine with 5.6 as expected. Please upgrade. Closing this bug.

Changed in percona-xtradb-cluster:
status: Confirmed → Won't Fix
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-1242

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.