[MCOL-1642] Add SQL command that shows Primary Front-End MariaDB ColumnStore Module Created: 2018-08-13  Updated: 2018-11-14  Resolved: 2018-11-14

Status: Closed
Project: MariaDB ColumnStore
Component/s: MDB Plugin
Affects Version/s: 1.2
Fix Version/s: 1.2.1

Type: New Feature Priority: Major
Reporter: markus makela Assignee: Andrew Hutchings (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MXS-1467 MaxScale should monitor ColumnStore s... Closed
Sprint: 2018-19, 2018-20

 Description   

A command that shows whether a UM is the primary one is needed for MXS-1467. Adding a command (a function, variable or a table) allows users to know whether DDL statements can be executed on the UM.



 Comments   
Comment by Andrew Hutchings (Inactive) [ 2018-09-17 ]

markus makela would you prefer this to be in the form of a UDF?

Comment by markus makela [ 2018-09-24 ]

We just need access to it via the SQL interface. Anything else works for us but to keep it consistent, it could be a function.

Comment by markus makela [ 2018-10-29 ]

I'll define the preliminary function name as mcsSystemPrimary and work based on the assumption that this function returns 1 if the system is the primary UM and 0 if it's not.

Comment by David Hall (Inactive) [ 2018-10-29 ]

I will create the function as Markus describes.

Comment by David Hall (Inactive) [ 2018-11-01 ]

To test, on any multi-UM system run:
UM1:
MariaDB [(none)]> select mcsSystemPrimary();
--------------------

mcsSystemPrimary()

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

1

--------------------
1 row in set (0.005 sec)
UM2...N
MariaDB [(none)]> select mcsSystemPrimary();
--------------------

mcsSystemPrimary()

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

0

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

Comment by Andrew Hutchings (Inactive) [ 2018-11-09 ]

Re-assigned to me to review since Ben is away

Comment by markus makela [ 2018-11-13 ]

Where are the tests for columnstore located?

Comment by markus makela [ 2018-11-13 ]

Manually tested and the function seems to work. It returns 1 on the primary UM and 0 on secondary.

Comment by markus makela [ 2018-11-13 ]

Added a simple test case and assigned it for review.

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