Skip to content
This repository was archived by the owner on Oct 29, 2023. It is now read-only.

Custom 'CHANGE MASTER TO' params #107

Closed
shlomi-noach opened this issue Apr 26, 2020 · 6 comments
Closed

Custom 'CHANGE MASTER TO' params #107

shlomi-noach opened this issue Apr 26, 2020 · 6 comments
Assignees

Comments

@shlomi-noach
Copy link

Is your feature request related to a problem? Please describe.
I wish to set up my replicas with specific parameters. e.g. MASTER_CONNECT_RETRY=1 (as opposed to the default 60) or MASTER_RETRY_COUNT=<somevalue>

The two specific replication params I mentioned are essential for quick(er) failure resolution.

Describe the solution you'd like
dbdeployer deploy to support --change-master-options [stringArray], similarly to --my-cnf-options. Example usage:

$ dbdeployer deploy replication 5.7.26 \
  --gtid \
  --my-cnf-options="slave_net_timeout=2" \
  --change-master-options="MASTER_CONNECT_RETRY=1" \
  --change-master-options="MASTER_RETRY_COUNT=10" \

Describe alternatives you've considered
the current alternative is to (post deploy) run stop slave; change master to... ; start slave on all replicas.

Thank you for your consideration.

@datacharmer
Copy link
Owner

Thanks for this feature request.
It can be added easily.
In the meantime, here's a workaround to achieve the goal with the current features:

  1. (optional) dbdeployer defaults templates list replication
  2. dbdeployer defaults templates show init_slaves_template > /tmp/init.tmpl
  3. Edit the file /tmp/init.tmpl to include the options you'd like.
  4. Run replication as
dbdeployer deploy replication 5.7.26 \
  --gtid \
  --my-cnf-options="slave_net_timeout=2" \
  --use-template=init_slave_template:/tmp/init.tmpl

The file initialize_slaves will be generated (and later run) with the changes you have added to the template. See Sandbox Customization for more info.

@shlomi-noach
Copy link
Author

Thank you, I can confirm the workaround works, per openark/orchestrator-ci-env#17

datacharmer added a commit that referenced this issue May 1, 2020
* Add `--change-master-options` (Issue #107)
* Add more tests
* Docker test now downloads latest 8.0 binaries instead of using built-in.
* Improve PXC handling of defaults across versions
* Fix defaults for PXC 5.6, which were broken after introducing support for PXC8.0 (Issue #106)
@datacharmer
Copy link
Owner

Implemented in v1.49.0

@shlomi-noach
Copy link
Author

Thank you for releasing v1.49.0! Just as addendum (possibly worth opening a new issue), dbdeployer deploy --help does not indicate the new --change-master-options flags, although I can confirm they work.

@datacharmer
Copy link
Owner

Thanks for confirming that the new flags works.

As for the help, the flag --change-master-options belongs to the sub-command deploy replication, not just deploy, as it is not applicable to single sandboxes. Similarly to the flag --prompt that applies to single deployments but not to replication.

@shlomi-noach
Copy link
Author

Perfect, thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants