mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-25 15:31: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 }}"
|
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
|
- name: Small pause to be sure the bin log, which was flushed previously, reached the replica
|
||||||
pause:
|
ansible.builtin.wait_for:
|
||||||
seconds: 2
|
timeout: 2
|
||||||
|
|
||||||
# Test primary log pos has been changed:
|
# Test primary log pos has been changed:
|
||||||
- name: Get replica status
|
- name: Get replica status
|
||||||
|
@ -218,13 +218,12 @@
|
||||||
fail_on_error: true
|
fail_on_error: true
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
# Task is changed with mysqlclient 2.0.1 and pymysql 0.9.3
|
# mysqlclient 2.0.1 always return "changed"
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- result is not changed
|
- result is not changed
|
||||||
when:
|
when:
|
||||||
- connector_name is search('pymysql')
|
- connector_name == 'pymysql'
|
||||||
- connector_ver is version('0.9.3', '<=')
|
|
||||||
|
|
||||||
# Test stopreplica mode:
|
# Test stopreplica mode:
|
||||||
- name: Stop replica
|
- name: Stop replica
|
||||||
|
@ -239,7 +238,12 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
- result.queries == ["STOP SLAVE"] or result.queries == ["STOP REPLICA"]
|
- 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:
|
# Test stopreplica mode:
|
||||||
|
# mysqlclient 2.0.1 always return "changed"
|
||||||
- name: Stop replica that is no longer running
|
- name: Stop replica that is no longer running
|
||||||
mysql_replication:
|
mysql_replication:
|
||||||
<<: *mysql_params
|
<<: *mysql_params
|
||||||
|
@ -251,6 +255,8 @@
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
when:
|
||||||
|
- connector_name == 'pymysql'
|
||||||
|
|
||||||
# master / slave related choices were removed in 3.0.0
|
# master / slave related choices were removed in 3.0.0
|
||||||
# https://github.com/ansible-collections/community.mysql/pull/252
|
# https://github.com/ansible-collections/community.mysql/pull/252
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue