[MDEV-16228] System variables retentive setting (a.k.a. SET PERSIST) Created: 2018-05-21 Updated: 2023-11-30 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Critical |
| Reporter: | Tadas Balaišis | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | Compatibility | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
I use 0 for autocommit variable. I was surprised a bit to find that setting SET global AUTOCOMMIT=0; is valid only until service restart. Then I get default (1) value again. To make it persistent I wrote it into my.cfg/my.ini file. Now it works. |
| Comments |
| Comment by Ian Gilfillan [ 2019-05-03 ] |
|
Added Compatibility label, as MySQL 8.0 has SET PERSIST (and SET PERSIST_ONLY). |
| Comment by Denis Denisov [ 2019-08-12 ] |
|
https://dev.mysql.com/doc/refman/8.0/en/reset-persist.html RESET PERSIST [[IF EXISTS] system_var_name] |
| Comment by Oleksandr Byelkin [ 2019-10-15 ] |
|
1) what if there is no any config file? |
| Comment by Tadas Balaišis [ 2019-10-16 ] |
|
I hope these questions are not for me. |
| Comment by Oleksandr Byelkin [ 2019-10-16 ] |
|
4) is about having code which rewrite config in the server. 5) rewriting confing is far from be atomic so you can just destroy config (tables looks way better at least aria are crash safe) |
| Comment by Ian Gilfillan [ 2019-11-26 ] |
|
To answer sanja's questions according to how MySQL does it: 1) It creates a separate file, mysqld-auto.cnf More info: |
| Comment by Oleksandr Byelkin [ 2019-11-26 ] |
|
no I am strictly against ability of the server to write any configuration file |
| Comment by Federico Razzoli [ 2021-04-06 ] |
|
As far as I understand, the only practical effect of this MySQL feature on real-world environments is bringing uncertainty about the actual servers configuration. It allows to change a variable and make the change survive a restart without changing my.cnf: this is strictly against the modern way to handle systems (infrastructure as code paradigm, devops, SRE, whatever). I agree that an SQL command should not modify a configuration file. That could even worsen the situation, because the actual configuration file on a server wouldn't match the one you have in your repository. Please, don't implement this command or any variant. |
| Comment by Ian Gilfillan [ 2023-03-08 ] |
|
Even though it's unclear whether this will be implemented, since it's still open, I'm linking it to the parent list of MySQL-8 compatibility tasks. |
| Comment by Michael Widenius [ 2023-09-29 ] |
|
We could have a special, always included 'persistent.cnf' file in that is modified with SET PERSISTENT ... |
| Comment by Federico Razzoli [ 2023-09-29 ] |
|
This would still cause inconsistencies between (for example) a user's Ansible repository and MariaDB configuration. Even if the repository contains persistent.cnf, it will be different from the one on the server. |