mysqld allows client connections even when in NON_PRIMARY view
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL patches by Codership |
Fix Released
|
Medium
|
Seppo Jaakola | ||
Trunk |
Fix Released
|
Medium
|
Seppo Jaakola |
Bug Description
Currently clients are allowed to connect to mysqld server even when it is in non-primary view. This is ugly as client gets aware of inability to replicate (and therefore, commit a transaction) only in the commit phase and gets the following error:
./sqlgen: Query failed: 1180: Got error 1 during COMMIT
Query was: 'COMMIT'
When mysqld has a non-primary view it should be largely unoperational. The best situation would be that it is not accessible via network, so that load balancer can easily detect a failed node. If this is too restrictive, server may demand that any connection that wants to do anything should first explicitly disable replication for session:
SET @@wsrep_on=0;
Such flexible behaviour might be complex to implement. An easy solution (now that we store state persistently) would be graceful restart and not returning from wsrep_init() until a primary view is received. From the log file it looks like server does not go to listen for connections until wsrep_init() completes.
Related branches
Changed in codership-mysql: | |
importance: | Undecided → Medium |
tags: |
added: non-primary removed: nonprimary |
Well, currently restarting means the node will loose all the information about cluster topology and won't know which nodes to reconnect to.
So for now the trick with global status variable wsrep_ready and thd->variables. wsrep_on seems to be the only solution.