community.mysql
community.mysql copied to clipboard
Support MAX_STATEMENT_TIME resource limit on MariaDB for mysql_user
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 https://github.com/ansible-collections/community.mysql/blob/663590689f3fe9aa94d223ccec527399c383480a/plugins/module_utils/user.py#L775 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.
@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:
- if mysql, use this query / this function
- 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
- grep through the files with
impland you'll find how to similar things work - also there are files in
plugins/module_utilsthat have functions that use version to identify if a feature is supported or not - they are used in the module, it's not hard to find
- 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.
closed via https://github.com/ansible-collections/community.mysql/pull/523