-
Notifications
You must be signed in to change notification settings - Fork 26
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
New module: proxysql_query_rules_fast_routing #26
New module: proxysql_query_rules_fast_routing #26
Conversation
I'll leave it like this for now, there is some problem in the logic with delete query rule (check mode) of one of the tests. I'll probably take a look tomorrow or later today. |
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.
@akimrx thanks for the module!
I didn't review in detail. The tests should be green, you can run them locally using docker before pushing (see integration and sanity guidelines on Ansible doc site).
@Andersson007 Hi! |
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
…y.proxysql into query-rules-fast-routing
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Each "apply suggestion" triggers a test that I can't cancel. It's a pain :( |
I was worried that the tests were running randomly, although I didn't want to, so I left to test the edits at home, I'll come back later |
fixed syntax, updated integration tests
Codecov Report
@@ Coverage Diff @@
## main #26 +/- ##
==========================================
- Coverage 70.02% 70.00% -0.03%
==========================================
Files 8 9 +1
Lines 994 1170 +176
Branches 164 195 +31
==========================================
+ Hits 696 819 +123
- Misses 222 261 +39
- Partials 76 90 +14
Continue to review full report at Codecov.
|
Integration tests are fixed, there are no more errors in them. As for the Sanity tests, they pass on the current versions, but for the developer version the test falls on the following:
This has nothing to do with this PR and is related to the upd If this option is not suitable, let's think about how to fix it. |
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
…y.proxysql into query-rules-fast-routing
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
…y.proxysql into query-rules-fast-routing
I have fixed some of the problems, in fact I don't have much time now, I will try to look at all the comments as soon as I get free. I also want to note that the style of writing the code and many of its features I took from the previous modules of this collection to keep the same style, it seems reasonable when the entire collection is written in the same style :) I definitely don't have time to refactor existing (old) modules before me. If this was a collection from scratch, I would write in a completely different style :) P.S. recent minor edits have led to Coverage swearing about uncovered tests, even though only the formatting has changed. It looks strange. |
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
The modules now are not idempotent. "well, there are kinds of modules where idempotence is basically impossible (reboot, shutdown, ...) or requires other information (command, shell, ...) but for modules which have a state parameter, this should be a real exception So if it's technically possible and there're no the mentioned limitations (i.e., to fetch the current state attributes and compare them with the desired state and update only when they don't match) , it should be done. About the inherited style - we should improve things whenever possible. |
It's not required to rewrite the old stuff. And this don't look complicated in general case:
I can't be 100% sure about ProxySQL but speaking about other RDBMS like Postgres or MySQL it's usually not a problem to make modules idempotent. If any questions, feel free to ask. P.S. Don't worry about codecov failings |
short_description: Modifies query rules for fast routing policies using the proxysql admin interface. | ||
description: | ||
- The M(community.proxysql.proxysql_query_rules_fast_routing) module modifies query rules for fast | ||
routing policies and attributes using the proxysql admin interface. |
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.
fast routing is only available in proxysql >=1.4.7.
that's long time ago. But it should be at least be mentioned in the docs.
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.
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.
Hi!
At the moment, I do not have time for open source at all, I do not know when I will be able to complete PR, because my son was born and I have a lot of tasks at my main job.
It will be cool if one of the participants completes what I started.
It seems that all that remains here is to add the correct mode for the -C
flag.
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.
@akimrx hi, thanks for the feedback! And my congratulations!:)
OK, I'll put the help_wanted
label and will change the description a bit, thank you! if you once decide to finish it, it would be great!
My test setup
[testing]
ubuntu ansible_connection=docker test playbook ---
- hosts: testing
tasks:
- name: change check mode
community.proxysql.proxysql_query_rules_fast_routing:
login_user: admin
login_password: admin
username: 'user_ro'
schemaname: 'default'
destination_hostgroup: 1
comment: 'fast route user_ro to default schema'
state: present
save_to_disk: yes
load_to_runtime: yes
check_mode: yes
- name: change
community.proxysql.proxysql_query_rules_fast_routing:
login_user: admin
login_password: admin
username: 'user_ro'
schemaname: 'default'
destination_hostgroup: 1
comment: 'fast route user_ro to default schema'
state: present
save_to_disk: yes
load_to_runtime: yes
- name: no change
community.proxysql.proxysql_query_rules_fast_routing:
login_user: admin
login_password: admin
username: 'user_ro'
schemaname: 'default'
destination_hostgroup: 1
comment: 'fast route user_ro to default schema'
state: present
save_to_disk: yes
load_to_runtime: yes
- name: no change check mode
community.proxysql.proxysql_query_rules_fast_routing:
login_user: admin
login_password: admin
username: 'user_ro'
schemaname: 'default'
destination_hostgroup: 1
comment: 'fast route user_ro to default schema'
state: present
save_to_disk: yes
load_to_runtime: yes
check_mode: yes results in
check_mode is working correctly for me |
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.
LGTM
oh wait |
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.
just the documentation is includes copy/paste error
@markuman will you have a chance to add more examples after this is merged and add |
Co-authored-by: Markus Bergholz <git@osuv.de>
SUMMARY
IF ANYONE WANTS TO FINISH IT BECAUSE OF #26 (comment), FEEL FREE TO DO IT!
New module for fast routing query rules.
ProxySQL documentation
ISSUE TYPE
COMPONENT NAME
proxysql_query_rules_fast_routing
ADDITIONAL INFORMATION
Closes #8