Can the slave of pxc change master to another memeber of the cluster just by use auto_position?

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

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.

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?