[MDEV-9301] USE fails with an illogical error if wsrep_on = 1 Created: 2015-12-17  Updated: 2016-08-18  Resolved: 2016-08-18

Status: Closed
Project: MariaDB Server
Component/s: Galera
Affects Version/s: 10.1.9
Fix Version/s: 10.1.9

Type: Bug Priority: Major
Reporter: Federico Razzoli Assignee: Nirbhay Choubey (Inactive)
Resolution: Cannot Reproduce Votes: 0
Labels: None


 Description   

On a fresh, not still connected node:

MariaDB [db2]> SET GLOBAL wsrep_on := 1;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [db2]> CREATE DATABASE x;
Query OK, 1 row affected (0.00 sec)
 
MariaDB [db2]> USE x;
ERROR 1047 (08S01): WSREP has not yet prepared node for application use
MariaDB [db2]> CREATE TABLE x.t (a INT);
Query OK, 0 rows affected (0.24 sec)
 
MariaDB [db2]> INSERT INTO x.t VALUES (1);
Query OK, 1 row affected (0.00 sec)
 
MariaDB [db2]> SELECT * FROM x.t;
+------+
| a    |
+------+
|    1 |
+------+
1 row in set (0.00 sec)
 
MariaDB [db2]> DROP TABLE x.t;
Query OK, 0 rows affected (0.07 sec)
 
MariaDB [db2]> DROP DATABASE x;
Query OK, 0 rows affected (0.01 sec)

It seems that I can run any command except for USE (which seems to me a harmless command...).



 Comments   
Comment by Elena Stepanova [ 2015-12-26 ]

f_razzoli,

Did you try to run it again? If you did, it's not in the log.
You could have hit a race condition, the real time interval when the node was being prepared.
If the issue is persistent, please provide the error log, output of SHOW STATUS and SHOW VARIABLES.

Tanks.

Comment by Federico Razzoli [ 2015-12-26 ]

I got it several times, but now I am not able to reproduce it.

Comment by Elena Stepanova [ 2015-12-26 ]

Maybe nirbhay_c has any ideas what can cause this.

Comment by Federico Razzoli [ 2015-12-26 ]

But, let's assume that the error was correct because the node wasn't prepared yet. Why all other operations were permitted?

Comment by Nirbhay Choubey (Inactive) [ 2015-12-29 ]

USE command internally does a SELECT DATABASE and thus it has to wait for latest snapshot.
I tried executing it on 10.1.10 and it worked as expected.

Why all other operations were permitted?

What other operations did you try? Anything other than SHOW & SET should have failed with
the same error. There is also a possibility that USE was run when the node was not ready while
at the time you tried other commands, the node was up-to-date and accepted these commands.

Generated at Thu Feb 08 07:33:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.