Skip to content
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

Support MAX_STATEMENT_TIME resource limit on MariaDB for mysql_user #211

Closed
joekeilty-oub opened this issue Aug 26, 2021 · 2 comments
Closed
Labels
help wanted Extra attention is needed

Comments

@joekeilty-oub
Copy link

SUMMARY

Currently, the following resource limits are supported in mysql_user module for resource_limits parameter:

MAX_QUERIES_PER_HOUR: num, MAX_UPDATES_PER_HOUR: num, MAX_CONNECTIONS_PER_HOUR: num, MAX_USER_CONNECTIONS: num.

MariaDB supports another resource limit: MAX_STATEMENT_TIME. As seen: https://mariadb.com/kb/en/grant/#resource-limit-options

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

mysql_user module, I think

current_limits = {
is where the code is

ADDITIONAL INFORMATION

My use case is I have a backup user that performs tasks with mysqldump and mysql bin logs who would like to have a greater max_statement_time than what I have default limit globally.

I would like to adjust the max statement time resource limit just for this user.

@Andersson007
Copy link
Collaborator

@joekeilty-oub hi, thanks for the issue!
It seems that the option was introduced in 10.1.1 https://mariadb.com/kb/en/aborting-statements/.
So we should consider 1) implementation (mysql/mariadb) and 2) mariadb version.
It shouldn't be hard. The logic roughly:

  1. if mysql, use this query / this function
  2. if mariadb of version 10.1.1, use that SQL / that function

I could take a look but would be nice to have more people involved.
If anyone wants to pick it up

  1. grep through the files with impl and you'll find how to similar things work
  2. also there are files in plugins/module_utils that have functions that use version to identify if a feature is supported or not
  3. they are used in the module, it's not hard to find
  4. we have a quick start dev guide that helps setup everything needed quickly and submit a PR
    https://github.com/ansible/community-docs/blob/main/create_pr_quick_start_guide.rst

I'd be happy to review / help.

If anyone wants to fix it, please put it here explicitly to avoid parallel work.

If there are no volunteers, I'll probably take it in a month or so.

@Andersson007 Andersson007 added the help wanted Extra attention is needed label Aug 27, 2021
@Andersson007
Copy link
Collaborator

closed via #523

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants