From 6077291f2785de959f2f1c1242c66833eba42b90 Mon Sep 17 00:00:00 2001 From: suetin Date: Mon, 7 Aug 2023 17:18:00 +0300 Subject: [PATCH] fix external repl switchover, add mysql-db ignore in external repl --- internal/app/app.go | 8 ++++++++ internal/mysql/node.go | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/app/app.go b/internal/app/app.go index a36d8cd3..c47f4b80 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -1604,6 +1604,14 @@ func (app *App) repairSlaveNode(node *mysql.Node, clusterState map[string]*NodeS if err != nil { app.logger.Errorf("repair: %s", err) } + err = node.StopExternalReplication() + if err != nil { + app.logger.Errorf("repair: %s", err) + } + err = node.ResetExternalReplicationAll() + if err != nil { + app.logger.Errorf("repair: %s", err) + } app.logger.Infof("repair: turning stale master %s to new master %s", host, master) err = app.performChangeMaster(host, master) if err != nil { diff --git a/internal/mysql/node.go b/internal/mysql/node.go index 893c67cd..24c2e001 100644 --- a/internal/mysql/node.go +++ b/internal/mysql/node.go @@ -999,8 +999,8 @@ func (n *Node) SetExternalReplication() error { return err } err = n.execMogrify(queryIgnoreDB, map[string]interface{}{ - "ignoreList": schemaname("mysql"), - "channel": "external", + "ignoreList": schemaname("mysql"), + "channel": "external", }) return n.StartExternalReplication() }