Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

orchestrator api graceful-master-takeover does not always return a code #949

@laurent-indermuehle

Description

@laurent-indermuehle

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):

  1. 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
  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions