-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MariaDB HA via Galera and tests #23
base: master
Are you sure you want to change the base?
Conversation
jcpowermac
commented
Feb 16, 2018
•
edited
Loading
edited
- Adds an HA plan which is provided using Galera.
- Adds testing for HA only (communication to the mariadb service using the other plans does not function needs additional investigation)
@jmontleon can I get a review cc: @tchughesiv |
@jcpowermac @djzager @jwmatthews @dymurray Overall this looks like a good start to me. I'll try to give it a test drive today. One concern I have right now this repo serves as the source for both the upstream and downstream apb role packages but this diverges pretty significantly from what we are shipping downstream (and maybe even what we are able to?) For the mediawiki where we have a different downstream/upstream image we deploy we created a patch file. This gets applied whenever we don't build in the upstream copr: I don't have a better idea at the moment as to how we handle this, but it also feels like the diff could get out of hand and become a pain to manage rather quickly in a more advanced case where we're ripping out entire plans as well. Does anyone have a better idea? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @jmontleon that this is a good start. I had a few comments just from looking it over.
I am a fan of the testing included, although slightly hard to follow between test_tasks.yml
and separately including (ha|dev|prod).yml
tasks conditionally on the plan & action variables. I believe we can do better than that.
This is the first example of a test playbook that I have seen that actually does testing instead of simple verifications. @dymurray would be proud.
I'm curious about two things:
- Could/would/should this be a separate APB entirely with development and production plans for
mariadb-ha
? (I'm not suggesting this is the route we should take, just trying to give possibilities based on @jmontleon 's comments) - Is it possible for
ha
to be a parameter instead of a separate plan? We currently have dev|prod plans for mariadb (not ha), why not dev|prod plans for mariadb-ha?
vars: | ||
plan: "{{ outer_item }}" | ||
with_items: | ||
- ha |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only ha
? I see you've added dev
, ha
, prod
to playbooks/vars/, but it only looks like you are using the one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djzager I kept having problems with the tests failing for dev
and prod
. Specifically when trying to the mysql commands to create the table via either the service or pod ip address. Its something I figured after I got this PR merged that I could look into more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is fair to me. Adding a todo for the remainder would be a good idea then.
--- | ||
_apb_plan_id: "dev" | ||
service_name: "rhscl-mariadb" | ||
namespace: "test-{{ _apb_plan_id }}-{{ service_name }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we not able to push most of these variables down into the role vars/defaults?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe this is as practical as I originally thought when making the comment, however I do believe the simpler our Ansible code, the better.
- set_fact: | ||
podobj: "{{ pods.stdout | from_json }}" | ||
|
||
# Create table using service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look @dymurray it's a test.yml and I like it.
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting my earlier comments into a review.
@@ -32,12 +34,24 @@ | |||
protocol: TCP | |||
target_port: 3306 | |||
register: mariadb_service | |||
when: | |||
- _apb_plan_id != "ha" | |||
- action != "test" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like it if we could move away from our reliance on conditionals.
@@ -61,6 +65,15 @@ plans: | |||
parameters: *_params | |||
updates_to: | |||
- prod | |||
- name: ha |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would like for this to be a parameter instead of a plan.
@djzager I can start making the changes from a plan -> parameter but that doesn't seem to resolve @jmontleon concerns. |
😎 @jcpowermac I knew I was forgetting something. @jmontleon I have a few questions that I'm not sure how to answer.
If we are not able to support HA downstream, this appears to require a much more significant patch to the downstream environment than what we have in mediawiki. Maybe we should schedule a meeting to discuss this in detail? |
@djzager / @jmontleon both are software collection images the only difference is RHEL vs CentOS. The problem with both is they don't provide the galera packages or |
@djzager here is an example of using a dictionary to determine state to reduce the amount of conditionals: https://github.com/jcpowermac/ansible-statemachine-test. I am not sure this really reduces any complexity. If this isn't the direction you are thinking it might help if you create an example. The problem is the database APBs are not simple (dev/prod +ha +update +testing) and the ansible to support all those options is complex. |
@jcpowermac Thank you for the example. I need to spend some more time thinking about this PR ahead of our call tomorrow. So that you are aware, I have been working on an APB reference example and one notable omission is a test playbook. After playing around with With those things in mind and your excellent use of the test playbook, I need to do some work on the the APB reference example. |