[MDEV-32041] "plugin already loaded" should be a Warning, not an Error Created: 2023-08-30 Updated: 2023-12-09 Resolved: 2023-12-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Plugins |
| Affects Version/s: | None |
| Fix Version/s: | 10.4.33, 10.5.24, 10.6.17, 10.11.7, 11.0.5, 11.1.4, 11.2.3 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Hartmut Holzgraefe | Assignee: | Daniel Black |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| 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. |
| Comments |
| Comment by Daniel Black [ 2023-08-31 ] | ||||||||||||||||||||||||||||||
|
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? | ||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2023-08-31 ] | ||||||||||||||||||||||||||||||
|
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" | ||||||||||||||||||||||||||||||
| Comment by Hartmut Holzgraefe [ 2023-10-02 ] | ||||||||||||||||||||||||||||||
|
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. | ||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-10-12 ] | ||||||||||||||||||||||||||||||
|
The implementation in https://github.com/MariaDB/server/pull/2744 also covers this case.
|