# Can the slave of  pxc change master to another memeber of the cluster just by use auto\_position?

**URL:** <https://forums.percona.com/t/can-the-slave-of-pxc-change-master-to-another-memeber-of-the-cluster-just-by-use-auto-position/8070>\
**Category:** Percona XtraDB Cluster 5.x\
**Created:** [September 23, 2020, 8:25am UTC](https://forums.percona.com/t/can-the-slave-of-pxc-change-master-to-another-memeber-of-the-cluster-just-by-use-auto-position/8070 "2020-09-23T08:25:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/fan/32/40_2.png) [@Fan](https://forums.percona.com/u/Fan)\
**Post date:** [September 23, 2020, 8:25am UTC](https://forums.percona.com/t/can-the-slave-of-pxc-change-master-to-another-memeber-of-the-cluster-just-by-use-auto-position/8070/1 "2020-09-23T08:25:25Z")

</div>

I once read an article( [https://www.percona.com/blog/2013/06/21/changing-an-async-slave-of-a-pxc-cluster-to-a-new-master/](https://www.percona.com/blog/2013/06/21/changing-an-async-slave-of-a-pxc-cluster-to-a-new-master/))this article roughly means: if there is a pxc cluster, it contains three nodes p1 p2 p3, p1 has a slave s1.

if we want to change s1’s master to p2 , we must analyze the binlog of p1 and p2 to find the file pos corresponding to the same xid

But what if we turn on GTID? I read some books(chinese books) said that I still need to use xid and can not just use change master auto\_position=1

The steps are probably:

1.get pxc cluster’s uuid, get execute\_gtid\_set on s1: “uuid:100”

2.use the gtid “uuid:100” to find the xid in p1’s binlog

3.use the xid to find gtid in p2’s binlog ,such as: “uuid:105”

4.on s1 reset master, set gtid\_purged=uuid:105

5.change mastet to p2 auto\_position=1

The above steps are very unfriendly, especially when using downstream consumer components(CDC) such as canal, debezium

My question is in version 5.7.30, do I still need to do this?

My English is not very good, please forgive me

---

<div class="post-metadata">

**Author:** ![jrivera](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jrivera/32/13_2.png) [@jrivera](https://forums.percona.com/u/jrivera)\
**Post date:** [October 7, 2020, 1:18am UTC](https://forums.percona.com/t/can-the-slave-of-pxc-change-master-to-another-memeber-of-the-cluster-just-by-use-auto-position/8070/2 "2020-10-07T01:18:41Z")

</div>

Are you distributing writes to all nodes P{1,2,3}? How is server-id setup on the cluster nodes, do they use the same server-id or different ids?

If you write on multiple nodes and then configured server-id on each node differently then most likely you’d have to do the Xid method. Otherwise it should be fine just to point the slave from one cluster node to another when GTID mode is enabled on all nodes.

---

<div class="post-metadata">

**Author:** ![Fan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/fan/32/40_2.png) [@Fan](https://forums.percona.com/u/Fan)\
**Post date:** [October 9, 2020, 3:44am UTC](https://forums.percona.com/t/can-the-slave-of-pxc-change-master-to-another-memeber-of-the-cluster-just-by-use-auto-position/8070/3 "2020-10-09T03:44:19Z")

</div>

we only write one node, and the server-id in different on all node, gtid is enabled

So in this scenario can I switch the master just use change master to … auto\_position=1?
