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

"plugin already loaded" should be a Warning, not an Error

Details

    Description

      When there are multiple requests to load the same plugin, e.g. both a "plugin_load_add" in the config file and an entry in the mysql.plugin table via "INSTALL PLUGIN", an error message is logged, e.g.:

      [ERROR] mariadbd: Plugin 'unix_socket' is already installed.

      IMHO this should only be a warning, not an error, as initial loading of the plugin was successful, so no real damage is done by the 2nd loading attempt in most cases.

      The exception would be an attempt to load a different version of the same plugin library, but even then a warning should be sufficient IMHO, especially as even the current error output does not terminate server startup.

      So both a warning and the current error would go unnoticed if a user doesn't bother to check the error log output, but the current error messages makes the situation sound much more critical than it actually is.

      Attachments

        Issue Links

          Activity

            hholzgra Hartmut Holzgraefe created issue -
            hholzgra Hartmut Holzgraefe made changes -
            Field Original Value New Value
            hholzgra Hartmut Holzgraefe made changes -
            danblack Daniel Black added a comment -

            10.4+:

            Can't INSTALL PLUGIN IF NOT EXISTS be used to downgrade any error to a warning?

            If a replacement is desired can UNINSTALL PLUGIN IF EXISTS be used before the INSTALL PLUGIN?

            danblack Daniel Black added a comment - 10.4+: Can't INSTALL PLUGIN IF NOT EXISTS be used to downgrade any error to a warning? If a replacement is desired can UNINSTALL PLUGIN IF EXISTS be used before the INSTALL PLUGIN?
            danblack Daniel Black made changes -
            Status Open [ 1 ] Needs Feedback [ 10501 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            julien.fritsch Julien Fritsch made changes -
            Assignee Dmitry Shulga [ JIRAUSER47315 ]
            danblack Daniel Black made changes -

            IF NOT EXISTS would be more consistent with other statements. For example, DROP TABLE fails if the table doesn't exist, it's not a warning because "the table doesn't exist after the statement anyway, no real damage was done"

            serg Sergei Golubchik added a comment - IF NOT EXISTS would be more consistent with other statements. For example, DROP TABLE fails if the table doesn't exist, it's not a warning because "the table doesn't exist after the statement anyway, no real damage was done"
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s N/A [ 14700 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Resolution Incomplete [ 4 ]
            Status Needs Feedback [ 10501 ] Closed [ 6 ]

            This was not so much about error handling on INSTALL PLUGIN, but about a plugin already installed, and so present in the mysql.plugin table, also being loaded via plugin_load_add in the config file(s).

            As plugin_load_add happens first when the mysql.plugin table contents are processed later during startup that "Error: plugin already loaded" log line is now raised on every startup, while typically this is not actually much of a problem as trying to load a plugin that is already loaded would just be an idempotent operation.

            The server will function the same way regardless of whether a plugin is loaded via plugin_load_add or a prior INSTALL PLUGIN, thus my reasoning that this should merely be a warning, not an error, as server functionality is not impacted.

            hholzgra Hartmut Holzgraefe added a comment - This was not so much about error handling on INSTALL PLUGIN, but about a plugin already installed, and so present in the mysql.plugin table, also being loaded via plugin_load_add in the config file(s). As plugin_load_add happens first when the mysql.plugin table contents are processed later during startup that "Error: plugin already loaded" log line is now raised on every startup, while typically this is not actually much of a problem as trying to load a plugin that is already loaded would just be an idempotent operation. The server will function the same way regardless of whether a plugin is loaded via plugin_load_add or a prior INSTALL PLUGIN, thus my reasoning that this should merely be a warning, not an error, as server functionality is not impacted.
            hholzgra Hartmut Holzgraefe made changes -
            Resolution Incomplete [ 4 ]
            Status Closed [ 6 ] Stalled [ 10000 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s N/A [ 14700 ]
            julien.fritsch Julien Fritsch made changes -
            Status Stalled [ 10000 ] Open [ 1 ]
            serg Sergei Golubchik made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.10 [ 27530 ]
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.0 [ 28320 ]
            Fix Version/s 11.1 [ 28549 ]
            danblack Daniel Black added a comment - - edited

            The implementation in https://github.com/MariaDB/server/pull/2744 also covers this case.

            MariaDB [(none)]> install soname 'locales.so';
            Query OK, 0 rows affected (0.001 sec)
             
            MariaDB [(none)]> shutdown;
            Query OK, 0 rows affected (0.000 sec)
            

            $ sql/mariadbd --no-defaults --datadir=/tmp/${PWD##*/}-datadir --socket=/tmp/${PWD##*/}.sock --plugin-dir=${PWD}/mysql-test/var/plugins/ --verbose --skip-networking --plugin-load-add=locales
            2023-10-13 10:07:41 0 [Note] Starting MariaDB 10.4.32-MariaDB source revision 3981e9cb385d435d17772c38504982ae9cf8293b as process 39312
            2023-10-13 10:07:41 0 [Note] InnoDB: Using Linux native AIO
            2023-10-13 10:07:41 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
            2023-10-13 10:07:41 0 [Note] InnoDB: Uses event mutexes
            2023-10-13 10:07:41 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
            2023-10-13 10:07:41 0 [Note] InnoDB: Number of pools: 1
            2023-10-13 10:07:41 0 [Note] InnoDB: Using SSE2 crc32 instructions
            2023-10-13 10:07:41 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
            2023-10-13 10:07:41 0 [Note] InnoDB: Completed initialization of buffer pool
            2023-10-13 10:07:41 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
            2023-10-13 10:07:41 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
            2023-10-13 10:07:41 0 [Note] InnoDB: Creating shared tablespace for temporary tables
            2023-10-13 10:07:41 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
            2023-10-13 10:07:41 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
            2023-10-13 10:07:41 0 [Note] InnoDB: Waiting for purge to start
            2023-10-13 10:07:41 0 [Note] InnoDB: 10.4.32 started; log sequence number 60961; transaction id 20
            2023-10-13 10:07:41 0 [Note] InnoDB: Loading buffer pool(s) from /tmp/build-mariadb-server-10.4-datadir/ib_buffer_pool
            2023-10-13 10:07:41 0 [Note] Plugin 'FEEDBACK' is disabled.
            2023-10-13 10:07:41 0 [Note] InnoDB: Buffer pool(s) load completed at 231013 10:07:41
            2023-10-13 10:07:41 0 [Note] mariadbd: Plugin 'LOCALES' already installed
            2023-10-13 10:07:41 0 [Note] Reading of all Master_info entries succeeded
            2023-10-13 10:07:41 0 [Note] Added new Master_info '' to hash table
            2023-10-13 10:07:41 0 [Note] sql/mariadbd: ready for connections.
            Version: '10.4.32-MariaDB'  socket: '/tmp/build-mariadb-server-10.4.sock'  port: 0  Source distribution
            

            danblack Daniel Black added a comment - - edited The implementation in https://github.com/MariaDB/server/pull/2744 also covers this case. MariaDB [(none)]> install soname 'locales.so'; Query OK, 0 rows affected (0.001 sec)   MariaDB [(none)]> shutdown; Query OK, 0 rows affected (0.000 sec) $ sql/mariadbd --no-defaults --datadir=/tmp/${PWD##*/}-datadir --socket=/tmp/${PWD##*/}.sock --plugin-dir=${PWD}/mysql-test/var/plugins/ --verbose --skip-networking --plugin-load-add=locales 2023-10-13 10:07:41 0 [Note] Starting MariaDB 10.4.32-MariaDB source revision 3981e9cb385d435d17772c38504982ae9cf8293b as process 39312 2023-10-13 10:07:41 0 [Note] InnoDB: Using Linux native AIO 2023-10-13 10:07:41 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2023-10-13 10:07:41 0 [Note] InnoDB: Uses event mutexes 2023-10-13 10:07:41 0 [Note] InnoDB: Compressed tables use zlib 1.2.13 2023-10-13 10:07:41 0 [Note] InnoDB: Number of pools: 1 2023-10-13 10:07:41 0 [Note] InnoDB: Using SSE2 crc32 instructions 2023-10-13 10:07:41 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 2023-10-13 10:07:41 0 [Note] InnoDB: Completed initialization of buffer pool 2023-10-13 10:07:41 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). 2023-10-13 10:07:41 0 [Note] InnoDB: 128 out of 128 rollback segments are active. 2023-10-13 10:07:41 0 [Note] InnoDB: Creating shared tablespace for temporary tables 2023-10-13 10:07:41 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 2023-10-13 10:07:41 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. 2023-10-13 10:07:41 0 [Note] InnoDB: Waiting for purge to start 2023-10-13 10:07:41 0 [Note] InnoDB: 10.4.32 started; log sequence number 60961; transaction id 20 2023-10-13 10:07:41 0 [Note] InnoDB: Loading buffer pool(s) from /tmp/build-mariadb-server-10.4-datadir/ib_buffer_pool 2023-10-13 10:07:41 0 [Note] Plugin 'FEEDBACK' is disabled. 2023-10-13 10:07:41 0 [Note] InnoDB: Buffer pool(s) load completed at 231013 10:07:41 2023-10-13 10:07:41 0 [Note] mariadbd: Plugin 'LOCALES' already installed 2023-10-13 10:07:41 0 [Note] Reading of all Master_info entries succeeded 2023-10-13 10:07:41 0 [Note] Added new Master_info '' to hash table 2023-10-13 10:07:41 0 [Note] sql/mariadbd: ready for connections. Version: '10.4.32-MariaDB' socket: '/tmp/build-mariadb-server-10.4.sock' port: 0 Source distribution
            danblack Daniel Black made changes -
            Assignee Dmitry Shulga [ JIRAUSER47315 ] Daniel Black [ danblack ]
            danblack Daniel Black made changes -
            Assignee Daniel Black [ danblack ] Dmitry Shulga [ JIRAUSER47315 ]
            Status Confirmed [ 10101 ] In Review [ 10002 ]
            julien.fritsch Julien Fritsch made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            danblack Daniel Black made changes -
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.10 [ 27530 ]
            shulga Dmitry Shulga made changes -
            Assignee Dmitry Shulga [ JIRAUSER47315 ] Julien Fritsch [ julien.fritsch ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            julien.fritsch Julien Fritsch made changes -
            Assignee Julien Fritsch [ julien.fritsch ] Daniel Black [ danblack ]
            danblack Daniel Black made changes -
            issue.field.resolutiondate 2023-12-09 01:00:18.0 2023-12-09 01:00:17.62
            danblack Daniel Black made changes -
            Fix Version/s 10.4.33 [ 29516 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.0 [ 28320 ]
            Fix Version/s 11.1 [ 28549 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            JIraAutomate JiraAutomate made changes -
            Fix Version/s 10.5.24 [ 29517 ]
            Fix Version/s 10.6.17 [ 29518 ]
            Fix Version/s 10.11.7 [ 29519 ]
            Fix Version/s 11.0.5 [ 29520 ]
            Fix Version/s 11.1.4 [ 29024 ]
            Fix Version/s 11.2.3 [ 29521 ]
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 197571

            People

              danblack Daniel Black
              hholzgra Hartmut Holzgraefe
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.