Skip to content

Commit

Permalink
mysql_replication: fix failing when using primary_use_gtid with repli…
Browse files Browse the repository at this point in the history
…ca_ or slave_pos (#336)
  • Loading branch information
Andersson007 authored Apr 21, 2022
1 parent 641894e commit 450cb19
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/0-mysql_replication_replica_pos.yml
Original file line number Diff line number Diff line change
@@ -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).
2 changes: 2 additions & 0 deletions plugins/modules/mysql_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,8 @@ def main():
replica_term = 'REPLICA'
else:
replica_term = 'SLAVE'
if primary_use_gtid == 'replica_pos':
primary_use_gtid = 'slave_pos'

if mode == 'getprimary':
status = get_primary_status(cursor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<<: *mysql_params
login_port: '{{ mysql_replica1_port }}'
mode: startreplica
primary_use_gtid: replica_pos
fail_on_error: yes
register: result
ignore_errors: yes
Expand Down

0 comments on commit 450cb19

Please sign in to comment.