[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:
Blocks
blocks MXS-1467 MaxScale should monitor ColumnStore s... Closed
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:
https://github.com/mariadb-corporation/mariadb-columnstore-tools/tree/master/monitoring

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();
------------------

mcssystemready()

------------------

1

------------------
1 row in set (0.01 sec)

ma setsystemqueryready 0

MariaDB [(none)]> select mcssystemready();
------------------

mcssystemready()

------------------

0

------------------
1 row in set (0.01 sec)

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();
---------------------

mcssystemreadonly()

---------------------

0

---------------------
1 row in set (0.01 sec)

[root@local]#mariadb/columnstore/bin/dbrmctl readonly
OK.

MariaDB [(none)]> select mcssystemreadonly();
---------------------

mcssystemreadonly()

---------------------

1

---------------------
1 row in set (0.01 sec)

[root@local]# mariadb/columnstore/bin/dbrmctl readwrite
OK.

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
/root/columnstore/mariadb-columnstore-server
commit e0ae0d2fecf9941887478d9aa669c8b2d1092090
Merge: 21ec501 2490ddf
Author: benthompson15 <ben.thompson@mariadb.com>
Date: Fri Jan 19 12:39:05 2018 -0600
Merge pull request #84 from mariadb-corporation/MCOL-1159
MCOL-1159 Merge mariadb-10.2.12
/root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine
commit 201813d63d63e99e50f2474d1bf7d8428ac72119
Merge: 3748036 a002d33
Author: Andrew Hutchings <andrew@linuxjedi.co.uk>
Date: Fri Jan 19 19:40:18 2018 +0000
Merge pull request #373 from mariadb-corporation/MergeFix
Merge deleted change to include columnstoreversion.h

1. mcssystemready() worked correctly

2. setsystemqueryready returns more like debug values, not meant to end users

mcsadmin> setsystemqueryready
setsystemqueryready Fri Jan 19 22:50:57 2018

Enter 1 for set and 0 for clear
Please enter: 0

getSystemQueryReady = 64

setSystemQueryReady = 0

getSystemQueryReady = 0
mcsadmin> setsystemqueryready 1
setsystemqueryready Fri Jan 19 22:51:06 2018

getSystemQueryReady = 0

setSystemQueryReady = 1

getSystemQueryReady = 64

The command is also not in the help menu.

3. Having both mcssystemreadonly() and mcswritessuspended() is confusing.
There maybe a difference between system ready only and write suspended in terms of internal status or programming sense. The net effect is that the database is in ready mode. This SQL client function is user facing and i think we need to have just one of them.

The following is confusing:

MariaDB [mytest]> select mcssystemreadonly();
---------------------

mcssystemreadonly()

---------------------

0

---------------------
1 row in set (0.01 sec)

MariaDB [mytest]> create table t1 (c1 int) engine=columnstore;
ERROR 1815 (HY000): Internal error: CAL0002: Writing to the database is disabled.
MariaDB [mytest]> select mcsWritesSuspended();
----------------------

mcsWritesSuspended()

----------------------

1

----------------------
1 row in set (0.00 sec)

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
/root/columnstore/mariadb-columnstore-server
commit e5499e513d88a3dfefbe9a356e20a1bceb1bde38
Merge: 99cdb0a 4840a43
Author: david hill <david.hill@mariadb.com>
Date: Wed Jan 31 16:53:52 2018 -0600
Merge pull request #92 from mariadb-corporation/MCOL-1152
MCOL-1152: Change the debian package names.
/root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine
commit ffcc4e94ccd07b6bbdfc47531c4c2f065f3fab47
Merge: 05431bf 3fb5dde
Author: benthompson15 <ben.thompson@mariadb.com>
Date: Mon Feb 5 22:37:05 2018 -0600
Merge pull request #398 from mariadb-corporation/statuscontrol-fix
add ProcStatusControl to postConfigure setup

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.

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