Skip to content

Conversation

@eryx12o45
Copy link

SUMMARY
Added options to start and stop group replication

ISSUE TYPE
Feature Pull Request

COMPONENT NAME
mysql_replication module

ADDITIONAL INFORMATION
new version of #93

@eryx12o45 eryx12o45 changed the title Add options to start and stop group replication Draft: Add options to start and stop group replication Jun 14, 2024
Copy link
Collaborator

@Andersson007 Andersson007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eryx12o45 hello, thanks for the PR!
Do i understand it correctly that in our case it's tricky to cover this with integration tests? You tested it locally and it works OK, right?

Do others think if it's OK to merge the PR w/o integration testing?

Copy link
Collaborator

@laurent-indermuehle laurent-indermuehle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The integration tests have 1 primary and 2 replicas. It should be possible to tests this no?

@eryx12o45
Copy link
Author

Hi @Andersson007 and @laurent-indermuehle ,

thanks for your review. I will try to create some tests in the near future. I created this PR in the first place some time back when I was working at another place where we would have needed it, but since then changes jobs and am not working on this anymore. Nevertheless I thought it makes sense to finalize this PR and therefore re-created it with adapted settings. But now I have to build a local test env. I would assume it is possible to test it though. I hope code-wise it's ok for now though

@Andersson007
Copy link
Collaborator

Hi @Andersson007 and @laurent-indermuehle ,

thanks for your review. I will try to create some tests in the near future. I created this PR in the first place some time back when I was working at another place where we would have needed it, but since then changes jobs and am not working on this anymore. Nevertheless I thought it makes sense to finalize this PR and therefore re-created it with adapted settings. But now I have to build a local test env. I would assume it is possible to test it though. I hope code-wise it's ok for now though

@eryx12o45 hi, code-wise LGTM. Ideally would be great to have integration tests. If it's tricky (no idea), I'm OK with merging this provided the manual testing is done (though someone can break the code in future and we'll learn about it only via bug reports).
Thoughts @eryx12o45 @laurent-indermuehle ?

@laurent-indermuehle
Copy link
Collaborator

@eryx12o45 please have a look at the Makefile. It uses Podman to run the integration tests on your workstation. If you have a question about it you can ask me (either here or in our matrix.

I'm not a fan of incorporating code without proper tests. If down the line Oracle changes something to the group replication, due to the critical nature of the replication, I would like to know about it.

@laurent-indermuehle
Copy link
Collaborator

Sorry @eryx12o45, I should have point you to this file: https://github.com/ansible-collections/community.mysql/blob/main/TESTING.md

@Andersson007
Copy link
Collaborator

If there are any issue with running tests locally:

  • Convert the PR to draft (there's a button on this page)
  • Just push your tests and see the results here
  • When it's ready, convert it back, there'll be a button for that too

If you have not time at all, I don't know, just say it explicitly, maybe someone else could add testing directly to the PR

@eryx12o45
Copy link
Author

Heyho, thanks for pointing me to the docs. As said. I will definitely try to biuild some integration tests, might just take some time, but I promise to try to keep it shorter this time ;-)

@eryx12o45 eryx12o45 marked this pull request as draft June 20, 2024 12:41
@eryx12o45 eryx12o45 force-pushed the add_group_replication_option_to_mysql_replication_module branch 2 times, most recently from c66568e to dfefc76 Compare June 26, 2025 14:03
@codecov
Copy link

codecov bot commented Jun 26, 2025

Codecov Report

Attention: Patch coverage is 9.30233% with 39 lines in your changes missing coverage. Please review.

Project coverage is 76.54%. Comparing base (83ad0e8) to head (9e90a23).

Files with missing lines Patch % Lines
plugins/modules/mysql_replication.py 9.30% 39 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #647      +/-   ##
==========================================
- Coverage   79.90%   76.54%   -3.36%     
==========================================
  Files          32       20      -12     
  Lines        2871     2763     -108     
  Branches      719      704      -15     
==========================================
- Hits         2294     2115     -179     
- Misses        400      454      +54     
- Partials      177      194      +17     
Flag Coverage Δ
integration 75.82% <9.30%> (-1.06%) ⬇️
sanity ?
units ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Andersson007
Copy link
Collaborator

@eryx12o45 hi, thanks for continuing to work on this! Please click "Ready for review" when it's ready so that it's not a draft anymore. Thanks

@eryx12o45
Copy link
Author

Will do :-) I try to squeeze in som time whenever I can

@eryx12o45 eryx12o45 force-pushed the add_group_replication_option_to_mysql_replication_module branch 2 times, most recently from dac8e2b to f89e238 Compare July 15, 2025 06:11
@eryx12o45 eryx12o45 marked this pull request as ready for review July 15, 2025 08:30
@eryx12o45
Copy link
Author

@Andersson007 I tried my best to add test for everything, but the code coverage still says it's not tested. But I am not sure why. From my point of view it should be fine now.

@Andersson007
Copy link
Collaborator

@eryx12o45 Green codecov checks are recommended, please ignore them and focus on making the other checks green

@eryx12o45 eryx12o45 force-pushed the add_group_replication_option_to_mysql_replication_module branch from 01640cc to 54b4eff Compare July 15, 2025 10:35
@eryx12o45
Copy link
Author

@Andersson007 done :-)

Copy link
Collaborator

@Andersson007 Andersson007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eryx12o45 Thanks, I'll take a deeper look soon

@eryx12o45 eryx12o45 changed the title Draft: Add options to start and stop group replication Add options to start and stop group replication Jul 17, 2025
- result is changed
- result.queries | length > 0
- "'START GROUP_REPLICATION' in result.queries[0]"
when: result is not failed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
when: result is not failed
when: result is not failed

i see many ignore_erros + this condition. The thing is that we can't be sure our test work.
can we handle it somehow w/o using ignore_errors + run if not failed ?

Copy link
Collaborator

@Andersson007 Andersson007 Jul 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eryx12o45 ^ (besides the above, LGTM)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants