[MCOL-962] Function/table to find out if ColumnStore instance (UM) is ready to process SQL queries against ColumnStore tables Created: 2017-10-09 Updated: 2020-08-25 Resolved: 2018-02-07 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | None |
| Affects Version/s: | 1.0.11 |
| Fix Version/s: | 1.1.3 |
| Type: | New Feature | Priority: | Major |
| Reporter: | Valerii Kravchuk | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Sprint: | 2017-24, 2017-25, 2018-01, 2018-02, 2018-03 | ||||||||
| Description |
|
Currently there is no predefined way to check with SQL statement if ColumnStore UM is able to process SQL statements against ColumnStore tables. Surely, one can try to create customer UDF around mcsadmin command, or just try to create and access ColumnStore table and process errors etc, but official and supported way is still needed. It may be used by MaxScale or any monitoring software to decide how to route queries or when to alert DBA about the problem. |
| Comments |
| Comment by David Thompson (Inactive) [ 2017-10-10 ] | ||||||||
|
A nagios plugin compatible shell script wrapper is here: However i agree that for certain use cases a SQL based approach might be easier to consume. I suspect a udf / stored proc would be the most natural / easy to implement. | ||||||||
| Comment by David Thompson (Inactive) [ 2017-12-11 ] | ||||||||
|
This won't make 1.0.12 | ||||||||
| Comment by David Hall (Inactive) [ 2018-01-09 ] | ||||||||
|
Added the functions mcssystemready() and mcssystemreadonly() mcssystemready() tests if the system is ACTIVE as shown in getsysteminfo, if the DBRM is READY, and if the system is ready for queries (which means DMLProc is done with rollback). These are three independent statuses. All must be correct for systemready() to return 1. There is an undocumented feature in mcsadmin setsystemqueryready to test this state. Pass 1 to set the sytsem as query ready and 0 to make it not ready. MariaDB [(none)]> select mcssystemready();
------------------
------------------ ma setsystemqueryready 0 MariaDB [(none)]> select mcssystemready();
------------------
------------------ ma setsystemqueryready 0 Also, restarting while a large insert is taking place, causing a big rollback during the start is also a good way to test. To test mcssystemreadonly(), use the utility dbrmctl to set the system into readonly mode: ariaDB [(none)]> select mcssystemreadonly();
---------------------
--------------------- [root@local]#mariadb/columnstore/bin/dbrmctl readonly MariaDB [(none)]> select mcssystemreadonly();
---------------------
--------------------- [root@local]# mariadb/columnstore/bin/dbrmctl readwrite | ||||||||
| Comment by David Hall (Inactive) [ 2018-01-09 ] | ||||||||
|
Do we want to add a similar function for writes suspended? | ||||||||
| Comment by David Thompson (Inactive) [ 2018-01-09 ] | ||||||||
|
if we have systemReadOnly() wouldn't that returning true indicate that writes are suspended? | ||||||||
| Comment by David Hall (Inactive) [ 2018-01-09 ] | ||||||||
|
Readonly is caused by an operating fault. It's there to prevent writes to a potentially broken data set. Writes Suspended is a state the user puts the system in when doing maintenance to prevent writes during the maintenance window since they could be harmful. The two are not really related. | ||||||||
| Comment by David Hall (Inactive) [ 2018-01-09 ] | ||||||||
|
Added mcsWritesSuspended() which returns 1 only if mcsadmin suspendDataBaseWrites is active. | ||||||||
| Comment by David Hall (Inactive) [ 2018-01-09 ] | ||||||||
|
The function names are easy enough to change before we publish. It's very easy to add functions from the functionality found in mcsadmin that return a single value. With a little effort, set functions could be added. | ||||||||
| Comment by Ben Thompson (Inactive) [ 2018-01-16 ] | ||||||||
|
Review / Merged Probably should check out addmodule command with glusterFS storage in testing. | ||||||||
| Comment by Daniel Lee (Inactive) [ 2018-01-19 ] | ||||||||
|
Build verified: Github source 1.1.3-1 1. mcssystemready() worked correctly 2. setsystemqueryready returns more like debug values, not meant to end users mcsadmin> setsystemqueryready Enter 1 for set and 0 for clear getSystemQueryReady = 64 setSystemQueryReady = 0 getSystemQueryReady = 0 getSystemQueryReady = 0 setSystemQueryReady = 1 getSystemQueryReady = 64 The command is also not in the help menu. 3. Having both mcssystemreadonly() and mcswritessuspended() is confusing. The following is confusing: MariaDB [mytest]> select mcssystemreadonly();
---------------------
--------------------- MariaDB [mytest]> create table t1 (c1 int) engine=columnstore;
----------------------
---------------------- or vise versa. | ||||||||
| Comment by David Hall (Inactive) [ 2018-01-30 ] | ||||||||
|
Modified mcssystemreadonly to return 0 if writable, 1 if suspended (user action) and 2 if dbrm is read only (error condition) | ||||||||
| Comment by Ben Thompson (Inactive) [ 2018-02-05 ] | ||||||||
|
Reviewed / Merged | ||||||||
| Comment by Daniel Lee (Inactive) [ 2018-02-07 ] | ||||||||
|
Build verified: Github source 1.1.3-1 As today's Slack discussion concluded, these commands are not for human consumption. They are for tools and processes to interact with. Skipping testing for user friendliness. |