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

server_audit plugin locks mutex for every event when server_audit_logging=OFF

    XMLWordPrintable

Details

    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/

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              GeoffMontee Geoff Montee (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              4 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.