[MDEV-8236] make max_user_connections truly dynamic (as in MySQL) Created: 2015-05-26  Updated: 2015-10-31

Status: Open
Project: MariaDB Server
Component/s: Admin statements
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Martin Amps Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

The attached statement runs fine on MySQL, but not on MariaDB per this commit in 2011: https://github.com/MariaDB/server/commit/7800d93bc3caca0143334941f626dc6aa3ff2b26

MariaDB [(none)]> SET GLOBAL max_user_connections = 100;
ERROR 1290 (HY000): The MariaDB server is running with the --max-user-connections=0 option so it cannot execute this statement

The process doesn't have such an option as shown by ps:

mysql    17199  102 53.0 28224164 16560828 ?   Sl   May07 28884:15 /usr/sbin/mysqld --basedir=/usr --datadir=/opt/data --plugin-dir=/usr/lib/mysql/plugin --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306

MariaDB [(none)]> SELECT @@version;
+------------------------------+
| @@version                    |
+------------------------------+
| 10.0.14-MariaDB-1~wheezy-log |
+------------------------------+



 Comments   
Comment by Sergei Golubchik [ 2015-05-28 ]

This is done to fix the following bug: in MySQL if you set max_user_connections run-time, then existing connections won't be counted. You can set it to 10, but a user can already have a thousand of connections and he'll be able to open ten more.

A possible fix would be always to count user connections, but it would introduce an overhead for those many users, who don't use connection limits. MariaDB has implemented a different fix — don't count connections if started with max_user_connections=0, but don't allow max_user_connections to be set to non-zero value, because a correct connection counting in that case cannot be guaranteed.

There are other ways to fix this bug, we can consider them.

Comment by Kolbe Kegel (Inactive) [ 2015-05-29 ]

I would like to see MariaDB use some other solution, so that max_user_connections is truly a dynamic variable.

Comment by Sergei Golubchik [ 2015-05-29 ]

kolbe, yes, exactly. That's why it's a "Task", not a "Bug", and that's why it's not closed as "Won't Fix".

Generated at Thu Feb 08 07:25:39 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.