Skip to content

Commit 9737871

Browse files
authored
Merge pull request #53 from Aiven-Open/worktree-lock_mode_auto
mydumper: switch sync-thread-lock-mode from FTWRL to AUTO
2 parents 6530cba + 80d8782 commit 9737871

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

aiven_mysql_migrate/dump_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def get_dump_command(self, migration_method: MySQLMigrateMethod) -> List[str]:
224224
"--events",
225225
"--routines",
226226
"--chunk-filesize=1024",
227-
"--sync-thread-lock-mode=FTWRL",
227+
"--sync-thread-lock-mode=AUTO",
228228
"--no-backup-locks",
229229
"--skip-ddl-locks",
230230
"--checksum-all",

test/sys/test_migration.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ def test_migration_replication(
9696
assert len(res) == 1 and res[0]["ID"] == "test_data"
9797

9898
with src.cur() as cur:
99-
cur.execute(f"INSERT INTO {db_name}.test (ID) VALUES (%s)", ["repl_data"])
99+
cur.execute(f"INSERT INTO `{db_name}`.`test` (ID) VALUES (%s)", ["repl_data"])
100100
cur.execute("COMMIT")
101101

102102
for _ in range(5):
103103
with dst.cur() as cur:
104-
cur.execute(f"SELECT ID FROM {db_name}.test")
104+
cur.execute(f"SELECT ID FROM `{db_name}`.`test`")
105105
res = cur.fetchall()
106106
if len(res) == 2 and sorted(["test_data", "repl_data"]) == sorted([item["ID"] for item in res]):
107107
return
@@ -154,15 +154,15 @@ def test_migration_replication_with_reestablish_replication(
154154
assert server_uuid in meta["dump_gtids"]
155155

156156
with dst.cur() as cur:
157-
cur.execute(f"SELECT ID FROM {db_name}.test")
157+
cur.execute(f"SELECT ID FROM `{db_name}`.`test`")
158158
res = cur.fetchall()
159159
assert len(res) == 1 and res[0]["ID"] == "test_data"
160160

161161
with dst.cur() as cur:
162162
cur.execute("STOP REPLICA FOR CHANNEL ''")
163163

164164
with src.cur() as cur:
165-
cur.execute(f"INSERT INTO {db_name}.test (ID) VALUES (%s)", ["repl_data"])
165+
cur.execute(f"INSERT INTO `{db_name}`.`test` (ID) VALUES (%s)", ["repl_data"])
166166
cur.execute("COMMIT")
167167

168168
migration = MySQLMigration(
@@ -179,7 +179,7 @@ def test_migration_replication_with_reestablish_replication(
179179

180180
for _ in range(5):
181181
with dst.cur() as cur:
182-
cur.execute(f"SELECT ID FROM {db_name}.test")
182+
cur.execute(f"SELECT ID FROM `{db_name}`.`test`")
183183
res = cur.fetchall()
184184
if len(res) == 2 and sorted(["test_data", "repl_data"]) == sorted([item["ID"] for item in res]):
185185
return
@@ -215,11 +215,11 @@ def test_migration_fallback(src: MySQLConnectionInfo, dst: MySQLConnectionInfo,
215215
migration.start(migration_method=method, seconds_behind_master=0)
216216

217217
with dst.cur() as cur:
218-
cur.execute(f"SELECT ID FROM {db_name}.test")
218+
cur.execute(f"SELECT ID FROM `{db_name}`.`test`")
219219
res = cur.fetchall()
220220
assert len(res) == 1 and res[0]["ID"] == "test_data"
221221

222-
cur.execute(f"call {db_name}.test_proc(@body)")
222+
cur.execute(f"call `{db_name}`.`test_proc`(@body)")
223223
res = cur.fetchall()
224224
assert len(res) == 1 and res[0]["test_body"] == "test_body"
225225

test/unit/test_dump_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def _build_mydumper_cmd(databases, ssl=True):
134134
"--events",
135135
"--routines",
136136
"--chunk-filesize=1024",
137-
"--sync-thread-lock-mode=FTWRL",
137+
"--sync-thread-lock-mode=AUTO",
138138
"--no-backup-locks",
139139
"--skip-ddl-locks",
140140
"--checksum-all",

0 commit comments

Comments
 (0)