[MXS-95] Galera Monitor Improvement Created: 2015-04-14  Updated: 2017-12-01

Status: Closed
Project: MariaDB MaxScale
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1.1

Type: New Feature Priority: Trivial
Reporter: Joffrey MICHAIE (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Hi,

currently, galera monitor only one state, such as "Synced", to route queries.
But, if we use xtrabackup, the node could be in "Donor/Unsynced" and still accept reads and writes.

This is important if only one node is in the cluster, and another node starts synchronising from it.

The folowing ideal workflow should be available, at least as an option:

Monitor Start

  • Check if wsrep_cluster_status is 'Primary'
    If no -> no traffic
    If yes:
  • Check if wsrep_local_state_comment is Synced (or status is == 4)
    If 4: -> traffic
    If <> 2: -> no traffic
    If 2 (Donor/Unsynced):
  • Check wrep_sst_method variable if it is 'xtrabackup%'
    If no -> no traffic
    If yes -> traffic

Joffrey

I add a snippet used in python for reference:

 
# Check 1) We need to have "Primary State"
else:
cur = db.query('select variable_value from information_schema.global_status where variable_name="wsrep_cluster_status"') myreturn = cur.fetchone()
# Check 2) We must be in synced mode (local_state = 4)
if (myreturn[0] == "Primary"):
cur = db.query('select variable_value from information_schema.global_status where variable_name="wsrep_local_state"') myreturn = cur.fetchone()
if not (myreturn[0] == "4"):
if (myreturn[0] == "2"):
cur = db.query('select count(1) from information_schema.global_variables where variable_name="wsrep_sst_method" and variable_value like "xtrabackup%"') myreturn = cur.fetchone()
if (myreturn[0] == 0):
myerrors += 1
myerrormsg += "The node is in Donor mode, and you are not using xtrabackup SST" else:
myerrors += 1
myerrormsg += "The node is not Synced (4) or Donor (2)" else:
myerrors += 1
myerrormsg += "The node is not member of a Primary Cluster" if(myerrors > 0):
mariadb_offline(myerrormsg) else:
mariadb_online()



 Comments   
Comment by Guillaume Lefranc [ 2015-04-20 ]

Pushed as https://github.com/mariadb-corporation/MaxScale/pull/77

-GL

Comment by markus makela [ 2015-04-23 ]

Merged into develop. Closing.

Generated at Thu Feb 08 03:56:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.