You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 18, 2025. It is now read-only.
I'm trying to catch the return code of graceful-master-takeover command. Either a success, a failure or a refusal (If the destination is already the master per ex.).
Here's what I got so far (orchestrator 3.1.0):
Using orchestrator command. It works, but the output is not easy to grab from a script as it output SQL syntax errors :
orchestrator -c graceful-master-takeover -i mysql-customer1-t1:33005 -d mysql-customer1-t2:33005
2019-07-18 ERROR Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and cluster_name='mysql-customer1-t2:33005'' at line 6
2019-07-18 ERROR Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and cluster_name='mysql-customer1-t2:33005'' at line 6
mysql-test-t1:33005
mysqld5-bin.000010:1563
Using the API works in case of success or refusal. But in case of error, the timeout is super long and the output is again not easy to grab :
orchestrator-client -c api -path graceful-master-takeover/mysql-customer1-t2/33006/mysql-customer1-t1/33006 | jq -r '.[].Code, .Message'
#Already master
GracefulMasterTakeover: indicated designated instance mysql-customer1-t1:33006 must be directly replicating from the master mysql-customer1-t1:33006
# Success
OK
graceful-master-takeover: successor promoted
(syslog also report the SQL syntax error here)
# Failure (network down)
[looooong pause]
dial tcp 192.168.100.101:33006: connect: no route to host
# Failure (slave stopped too long for master to have binlog anymore)
Start SLAVE UNTIL is past coordinates: mysql-test-t2:33006
I was hopping orchestrator-client will always return a code. It's not the case.