Hi,
I'm a little confused about how to promote a new master in a GTID-enabled cluster using Orchestrator, and I'm hoping someone can help make things a bit clearer :)
In short, I can promote a new master via make-co-master and reset-slave and all is well so far, but I'm left in a state where I'm unable to do another promotion because Orchestrator reverts to "classic" replication the next time I attempt to issue make-co-master.
For my testing setup, I'm using Orchestrator 2.1.5 to manage a cluster of three nodes (running Percona 5.6.36-82.1-log) with GTID enabled.
I'm trying to get from here:
db1 [0s,ok,5.6.36-82.1-log,ro,ROW,>>,GTID]
+ db2 [0s,ok,5.6.36-82.1-log,ro,ROW,>>,GTID]
+ db3 [0s,ok,5.6.36-82.1-log,ro,ROW,>>,GTID]
To here:
db2 [0s,ok,5.6.36-82.1-log,ro,ROW,>>,GTID]
+ db1 [0s,ok,5.6.36-82.1-log,ro,ROW,>>,GTID]
+ db3 [0s,ok,5.6.36-82.1-log,ro,ROW,>>,GTID]
And then finally, some time later, to here:
db3 [0s,ok,5.6.36-82.1-log,ro,ROW,>>,GTID]
+ db1 [0s,ok,5.6.36-82.1-log,ro,ROW,>>,GTID]
+ db2 [0s,ok,5.6.36-82.1-log,ro,ROW,>>,GTID]
The first promotion is easily achieved by issuing make-co-master and reset-slave. However, at this point db2 has lost its GTID flag:
db2:3306 [0s,ok,5.6.36-82.1-log,ro,ROW,>>]
+ db1:3306 [0s,ok,5.6.36-82.1-log,ro,ROW,>>,GTID]
+ db3:3306 [0s,ok,5.6.36-82.1-log,ro,ROW,>>,GTID]
When I attempt the second promotion, again by issuing make-co-master to make db3 a co-master of db2, it fails with error 1776:
Error 1776: Parameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POSITION is active.
I have found that I can avoid this problem by using detach-replica-master-host rather than reset-slave, but that leaves me with a replication error on the demoted node and the risk of accidentally re-attaching it at any point in the future. Also, the option to detach from the master host is not present in Orchestrator's web interface, which leads me to believe it's not the ideal way to demote the node.
My assumption is that for any move operation on a node after a reset-slave, Orchestrator would prefer GTID replication if both the instance being moved and the destination instance have GTID enabled, but that does not seem to be the case.
Did I misunderstand how to perform a master promotion with GTID replication using Orchestrator? Is there a better way to do it that I'm missing?
Cheers,
Martin