mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-23 19:01:28 -07:00
mysql_replication: fix failing when using primary_use_gtid with replica_ or slave_pos (#336)
This commit is contained in:
parent
641894e6e8
commit
450cb19027
3 changed files with 5 additions and 0 deletions
2
changelogs/fragments/0-mysql_replication_replica_pos.yml
Normal file
2
changelogs/fragments/0-mysql_replication_replica_pos.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- mysql_replication - fails when using the `primary_use_gtid` option with `slave_pos` or `replica_pos` (https://github.com/ansible-collections/community.mysql/issues/335).
|
|
@ -532,6 +532,8 @@ def main():
|
||||||
replica_term = 'REPLICA'
|
replica_term = 'REPLICA'
|
||||||
else:
|
else:
|
||||||
replica_term = 'SLAVE'
|
replica_term = 'SLAVE'
|
||||||
|
if primary_use_gtid == 'replica_pos':
|
||||||
|
primary_use_gtid = 'slave_pos'
|
||||||
|
|
||||||
if mode == 'getprimary':
|
if mode == 'getprimary':
|
||||||
status = get_primary_status(cursor)
|
status = get_primary_status(cursor)
|
||||||
|
|
|
@ -75,6 +75,7 @@
|
||||||
<<: *mysql_params
|
<<: *mysql_params
|
||||||
login_port: '{{ mysql_replica1_port }}'
|
login_port: '{{ mysql_replica1_port }}'
|
||||||
mode: startreplica
|
mode: startreplica
|
||||||
|
primary_use_gtid: replica_pos
|
||||||
fail_on_error: yes
|
fail_on_error: yes
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue