[MDEV-7053] WSREP_STATUS & WSREP_MEMBERSHIP I_S tables Created: 2014-11-08  Updated: 2014-12-26  Resolved: 2014-11-22

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

Type: Task Priority: Major
Reporter: Nirbhay Choubey (Inactive) Assignee: Nirbhay Choubey (Inactive)
Resolution: Fixed Votes: 0
Labels: galera, plugins


 Description   

MariaDB Galera server currently dumps many node's status and cluster membership related information to the server logs. The idea behind this task is to make those information available to the user through INFORMATION_SCHEMA. Following is the sample output :

MariaDB [test]> INSTALL PLUGIN wsrep_status SONAME 'wsrep_status.so';
Query OK, 0 rows affected (0.03 sec)
 
MariaDB [test]> INSTALL PLUGIN wsrep_membership SONAME 'wsrep_status.so';
Query OK, 0 rows affected (0.16 sec)
 
MariaDB [test]> SELECT * FROM INFORMATION_SCHEMA.WSREP_STATUS;
+------------+-------------+----------------+--------------+--------------------------------------+---------------------+-----------------+-----+------------------+
| NODE_INDEX | NODE_STATUS | CLUSTER_STATUS | CLUSTER_SIZE | CLUSTER_STATE_UUID                   | CLUSTER_STATE_SEQNO | CLUSTER_CONF_ID | GAP | PROTOCOL_VERSION |
+------------+-------------+----------------+--------------+--------------------------------------+---------------------+-----------------+-----+------------------+
|          0 | Synced      | Primary        |            3 | 00b0fbad-6e84-11e4-8a8b-376f19ce8ee7 |                   2 |               3 | NO  |                3 |
+------------+-------------+----------------+--------------+--------------------------------------+---------------------+-----------------+-----+------------------+
1 row in set (0.00 sec)
 
MariaDB [test]> SELECT * FROM INFORMATION_SCHEMA.WSREP_MEMBERSHIP;
+-------+--------------------------------------+-------+-----------------+
| INDEX | UUID                                 | NAME  | ADDRESS         |
+-------+--------------------------------------+-------+-----------------+
|     0 | 46da96e3-6e9e-11e4-95a2-f609aa5444b3 | node1 | 10.0.2.15:16000 |
|     1 | 5f6bc72a-6e9e-11e4-84ed-57ec6780a3d3 | node2 | 10.0.2.15:16001 |
|     2 | 7473fd75-6e9e-11e4-91de-0b541ad91bd0 | node3 | 10.0.2.15:16002 |
+-------+--------------------------------------+-------+-----------------+
3 rows in set (0.00 sec)
 



 Comments   
Comment by Nirbhay Choubey (Inactive) [ 2014-11-08 ]

http://lists.askmonty.org/pipermail/commits/2014-November/006905.html

Comment by Jan Lindström (Inactive) [ 2014-11-12 ]

Ok to push. Just a question, can you query these even in case when
1) WITH_WSREP is not defined ?
2) wsrep_on == FALSE ?

Comment by Nirbhay Choubey (Inactive) [ 2014-11-12 ]

(1) Without WITH_WSREP, this plugin won't get build. Also, if we forcefully try to INSTALL this
plugin after copying the wsrep_status.so to lib/plugin/, the attempt would fail.

MariaDB [test]> install plugin wsrep_status soname 'wsrep_status.so';
ERROR 1126 (HY000): Can't open shared library '../lib/plugin/wsrep_status.so' (errno: 2, undefined symbol: LOCK_wsrep_config_state)

(2) When wsrep_on = 0 :

MariaDB [test]> SELECT * FROM INFORMATION_SCHEMA.WSREP_STATUS;
+------------+-------------+--------------+--------------------------------------+---------+-----+------------------+
| NODE_INDEX | NODE_STATUS | CLUSTER_SIZE | CLUSTER_UUID                         | PRIMARY | GAP | PROTOCOL_VERSION |
+------------+-------------+--------------+--------------------------------------+---------+-----+------------------+
|          0 | UNDEFINED   |            0 | 00000000-0000-0000-0000-000000000000 | YES     | NO  |                0 |
+------------+-------------+--------------+--------------------------------------+---------+-----+------------------+
1 row in set (0.00 sec)
 
MariaDB [test]> SELECT * FROM INFORMATION_SCHEMA.WSREP_MEMBERSHIP;
Empty set (0.00 sec)

Comment by Nirbhay Choubey (Inactive) [ 2014-11-17 ]

http://lists.askmonty.org/pipermail/commits/2014-November/007039.html

Comment by Nirbhay Choubey (Inactive) [ 2014-11-22 ]

https://github.com/MariaDB/server/commit/369c02674cb024ceb1995433913ef2fb32f815ca

Comment by Nirbhay Choubey (Inactive) [ 2014-12-24 ]

https://github.com/MariaDB/server/commit/03e0f1f86617c54722cc23f4f5c101d60adfa485

Comment by Joffrey MICHAIE (Inactive) [ 2014-12-24 ]

When wsrep is not ready to handle transactions, it is not possible to load the plugin, nor to query the tables.
Should it be a opened as another feature request, or can we follow up this here ?

MariaDB [(none)]>  INSTALL SONAME 'wsrep_status';
ERROR 1047 (08S01): WSREP has not yet prepared node for application use
 
MariaDB [(none)]>  SELECT * FROM INFORMATION_SCHEMA.WSREP_MEMBERSHIP;
ERROR 1047 (08S01): WSREP has not yet prepared node for application use

Comment by Nirbhay Choubey (Inactive) [ 2014-12-24 ]

Since INSTALL gets replicated, I think having it wait for the node to get ready seem OK. On the other
hand, detaching I_S queries from wsrep_ready sound like a perfectly valid use case. I have opened
an FR with upstream.
https://github.com/codership/mysql-wsrep/issues/36

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