community.mysql icon indicating copy to clipboard operation
community.mysql copied to clipboard

mysql_replication changemaster does not support GET_SOURCE_PUBLIC_KEY

Open ehudkaldor opened this issue 4 years ago • 4 comments

in mysql 8.0, setting replication source on the replica requires the parameter GET_SOURCE_PUBLIC_KEY=1 so the replica will grab the pub key from the source. This parameter does not exist in the collection

ISSUE TYPE
  • Bug Report
COMPONENT NAME
ANSIBLE VERSION
ansible 2.9.10
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/var/lib/awx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.6.8 (default, Apr 16 2020, 01:36:27) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]

CONFIGURATION
<empty>
OS / ENVIRONMENT

Ubuntu 20.04

STEPS TO REPRODUCE

see below

- mysql_replication:
    mode: changemaster
    master_host: "{{ primary_database }}"
    master_port: "{{ mysql_port }}"
    master_user: "{{ mysql_replication_user_name }}"
    master_password: "{{ mysql_replication_user_password }}"
    master_auto_position: 1
    get_master_public_key: 1

EXPECTED RESULTS

success

ACTUAL RESULTS

see below

Unsupported parameters for (mysql_replication) module: get_master_public_key Supported parameters include: ca_cert, client_cert, client_key, config_file, connect_timeout, login_host, login_password, login_port, login_unix_socket, login_user, master_auto_position, master_connect_retry, master_host, master_log_file, master_log_pos, master_password, master_port, master_ssl, master_ssl_ca, master_ssl_capath, master_ssl_cert, master_ssl_cipher, master_ssl_key, master_user, mode, relay_log_file, relay_log_pos"

ehudkaldor avatar May 09 '21 23:05 ehudkaldor

@ehudkaldor hi, thanks for reporting this! Would you like to add the feature yourself?

If no and anyone else wants to do it, please let us know by putting a comment here. We have a quick start guide which should help (or I could look but am not sure when).

Thanks

Andersson007 avatar May 10 '21 05:05 Andersson007

I think, three years past, that it's clear OP isn't going to :-p

I'm running into this as well; I'll have a look at the quickstart guide but I've never worked on ansible modules before, so unless it's pretty straightforward I don't think I'll have the time either.

I feel this is a pretty important bit, however, as it makes community.mysql.mysql_replication completely unusable on MySQL 8. Well, maybe not entirely, I think I'm just going to add a manual change master between the changemaster and startreplica steps, but that really shouldn't even be necessary.

meersjo avatar Mar 14 '24 11:03 meersjo

@meersjo thanks for the comment! I've just put a call for volunteers in our MySQL matrix channel, hope there'll be someone interesting in taking a closer look at the issue

Andersson007 avatar Mar 20 '24 11:03 Andersson007

I can confirm in the mean time that the workaround is indeed just an ansible.builtin.command that calls mysql -e 'change replica source to get_source_public_key=1;' .

I'd share the very simple task for others running into this, but I'm running containerized with aliases into the container instead of a client package, and calling bash aliases from ansible is a whole different can of worms :smiling_face_with_tear:

meersjo avatar Mar 25 '24 11:03 meersjo