[MDEV-19174] server_audit plugin locks mutex for every event when server_audit_logging=OFF Created: 2019-04-04 Updated: 2020-08-25 Resolved: 2019-06-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Locking, Plugin - Audit |
| Affects Version/s: | 10.4.3, 10.1.38, 10.2.23, 10.3.14 |
| Fix Version/s: | 10.2.26, 10.1.41, 10.3.17 |
| Type: | Bug | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Alexey Botchkov |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
The server_audit plugin uses the lock_operations mutex to perform various operations in a mutually exclusive manner: https://github.com/MariaDB/server/blob/mariadb-10.3.7/plugin/server_audit/server_audit.c#L544 As far as I can tell, this mutex is locked for every audit event, even when server_audit_logging=OFF is set. We can see that the mutex is locked here: https://github.com/MariaDB/server/blob/mariadb-10.3.7/plugin/server_audit/server_audit.c#L1989 And the code doesn't check whether logging is enabled until a few lines later: https://github.com/MariaDB/server/blob/mariadb-10.3.7/plugin/server_audit/server_audit.c#L2021 Is it absolutely necessary to do it this way? It seems as though users would pay a performance penalty to have the audit plugin installed if they have a lot of concurrent connections, even if server_audit_logging=OFF is set. It looks like the only way to prevent the mutex from being locked for every audit event is to uninstall the plugin with UNINSTALL PLUGIN / UNINSTALL SONAME: https://mariadb.com/kb/en/library/uninstall-plugin/ https://mariadb.com/kb/en/library/uninstall-soname/ |
| Comments |
| Comment by Alexey Botchkov [ 2019-04-08 ] |
|
This is a bigger issue. |