diff options
author | Zhao Chao <zhaochao1984@gmail.com> | 2018-03-08 17:09:14 +0800 |
---|---|---|
committer | Zhao Chao <zhaochao1984@gmail.com> | 2018-03-09 10:51:41 +0800 |
commit | 5895cf0ee99022e2910ec8c72393fe998f5860f8 (patch) | |
tree | 4ea64544c2eec93f7c27176f6af246036cc9e40c /releasenotes | |
parent | ad496c07980aa8d17eac6a1670f9e7c8ca816864 (diff) | |
download | trove-5895cf0ee99022e2910ec8c72393fe998f5860f8.tar.gz |
Avoid diverged slave when migrating MariaDB master
When promoting one slave to the new master in a replication group,
previously the old master will be attached to the new one right after
the new master is on. For MariaDB, attaching the old master to the new
one, new GTID may be created on the old master and also may be synced
to some of the other replicas, as they're still connecting to the old
master. The new GTID does not exists in the new master, making these
slaves diverged from the master. After that, when the diverged slave
connects to the new master, 'START SLAVE' will fail with logs like:
[ERROR] Error reading packet from server: Error: connecting slave
requested to start from GTID X-XXXXXXXXXX-XX, which is not in the
master's binlog. Since the master's binlog contains GTIDs with
higher sequence numbers, it probably means that the slave has
diverged due to executing extra erroneous transactions
(server_errno=1236)
And these slaves will be left orphan and errored after
promote_to_replica_source finishs.
Attaching the other replicas to the new master before dealing with the
old master will fix this problem and the failure of the
trove-scenario-mariadb-multi Zuul job as well.
Closes-Bug: #1754539
Change-Id: Ib9c01b07c832f117f712fd613ae55c7de3561116
Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
Diffstat (limited to 'releasenotes')
-rw-r--r-- | releasenotes/notes/avoid-diverged-slave-when-migrating-mariadb-master-37e2429a1ea75913.yaml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/releasenotes/notes/avoid-diverged-slave-when-migrating-mariadb-master-37e2429a1ea75913.yaml b/releasenotes/notes/avoid-diverged-slave-when-migrating-mariadb-master-37e2429a1ea75913.yaml new file mode 100644 index 00000000..f2c3f04c --- /dev/null +++ b/releasenotes/notes/avoid-diverged-slave-when-migrating-mariadb-master-37e2429a1ea75913.yaml @@ -0,0 +1,12 @@ +--- +fixes: + - | + MariaDB allows an server to be a master and a slave simutaneously, so when + migrating masters, if the old master is reactivated before attaching the + other replicas to the new master, new unexpected GTIDs may be created on + the old master and synced to some of the other replicas by chance, as the + other replicas are still connecting to the old one by the time. After that + these diverged slave will fail changing to the new master. This will be + fixed by first attaching the other replicas to the new master, and then + dealing with old master. + Fixes #1754539 |