Merge "Fix replication detach error"

This commit is contained in:
Zuul 2024-12-04 13:27:06 +00:00 committed by Gerrit Code Review
commit 3468240fae
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fix a bug where replications failed to detach from the source instance
because of the upgrade of the sqlachemy library.

View File

@ -815,7 +815,7 @@ class BaseMySqlApp(service.BaseDbApp):
replication_user = None
with mysql_util.SqlClient(self.get_engine()) as client:
result = client.execute(text('SHOW SLAVE STATUS'))
replication_user = result.first()['Master_User']
replication_user = result.first()._mapping['Master_User']
client.execute(text('STOP SLAVE'))
client.execute(text('RESET SLAVE ALL'))
self.wait_for_slave_status('OFF', client, 180)