Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-8236

max_user_connections behavior different from MySQL

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: Admin statements
    • 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 |
      +------------------------------+
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment - - edited

            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.

            Show
            serg Sergei Golubchik added a comment - - edited 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.
            Hide
            kolbe Kolbe Kegel added a comment -

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

            Show
            kolbe Kolbe Kegel added a comment - I would like to see MariaDB use some other solution, so that max_user_connections is truly a dynamic variable.
            Hide
            serg Sergei Golubchik added a comment -

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

            Show
            serg Sergei Golubchik added a comment - Kolbe Kegel , yes, exactly. That's why it's a "Task", not a "Bug", and that's why it's not closed as "Won't Fix".

              People

              • Assignee:
                Unassigned
                Reporter:
                MartinAmps Martin Amps
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: