mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-25 07:21:45 -07:00
Fix 2nd replication stop marked changed by mysqlclient
This commit is contained in:
parent
ef6a6c7573
commit
4a82e16121
1 changed files with 11 additions and 5 deletions
|
@ -184,8 +184,8 @@
|
|||
shell: "echo \"INSERT INTO {{ test_table }} (id) VALUES (1), (2), (3); FLUSH LOGS;\" | {{ mysql_command }} -P{{ mysql_primary_port }} {{ test_db }}"
|
||||
|
||||
- name: Small pause to be sure the bin log, which was flushed previously, reached the replica
|
||||
pause:
|
||||
seconds: 2
|
||||
ansible.builtin.wait_for:
|
||||
timeout: 2
|
||||
|
||||
# Test primary log pos has been changed:
|
||||
- name: Get replica status
|
||||
|
@ -218,13 +218,12 @@
|
|||
fail_on_error: true
|
||||
register: result
|
||||
|
||||
# Task is changed with mysqlclient 2.0.1 and pymysql 0.9.3
|
||||
# mysqlclient 2.0.1 always return "changed"
|
||||
- assert:
|
||||
that:
|
||||
- result is not changed
|
||||
when:
|
||||
- connector_name is search('pymysql')
|
||||
- connector_ver is version('0.9.3', '<=')
|
||||
- connector_name == 'pymysql'
|
||||
|
||||
# Test stopreplica mode:
|
||||
- name: Stop replica
|
||||
|
@ -239,7 +238,12 @@
|
|||
- result is changed
|
||||
- result.queries == ["STOP SLAVE"] or result.queries == ["STOP REPLICA"]
|
||||
|
||||
- name: Pause for 2 seconds to let the replication stop
|
||||
ansible.builtin.wait_for:
|
||||
timeout: 2
|
||||
|
||||
# Test stopreplica mode:
|
||||
# mysqlclient 2.0.1 always return "changed"
|
||||
- name: Stop replica that is no longer running
|
||||
mysql_replication:
|
||||
<<: *mysql_params
|
||||
|
@ -251,6 +255,8 @@
|
|||
- assert:
|
||||
that:
|
||||
- result is not changed
|
||||
when:
|
||||
- connector_name == 'pymysql'
|
||||
|
||||
# master / slave related choices were removed in 3.0.0
|
||||
# https://github.com/ansible-collections/community.mysql/pull/252
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue