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

Incorrect server_audit_file_buffer_size operation according to specification

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • N/A
    • N/A
    • Plugin - Audit
    • None
    • Not for Release Notes
    • Q3/2025 Maintenance

    Description

      In a comment on MDEV-34680, holyfoot clarified that a client exit doesn't flush the Audit log. Only a server shutdown does. However:

      INSTALL PLUGIN server_audit SONAME 'server_audit';
      SET GLOBAL server_audit_logging=ON;
      SET GLOBAL server_audit_file_buffer_size=8192;  # Apparent default of 8k
      SELECT 1;
      exit  # Close the current client connection
      ./bin/mariadb -S./socket.sock test  # Open a new client connection
      

      Results in a premature write of the Audit log upon the new client connection:

      bb-12.0-mdev-34680x3-hf CS 12.0.1 8ead5a2a8a15a95f060e02d26c1ed28800fbdb03 (Optimized, Clang) Build 02/07/2025

      $ cat data/server_audit.log; wc -c data/server_audit.log
      20250704 19:17:26,qa-roel-2,root,localhost,4,4,QUERY,test,'SET GLOBAL server_audit_logging=ON',0
      20250704 19:17:26,qa-roel-2,root,localhost,4,5,QUERY,test,'SET GLOBAL server_audit_file_buffer_size=8192',0
      20250704 19:17:26,qa-roel-2,root,localhost,4,6,QUERY,test,'SELECT 1',0
      20250704 19:17:26,qa-roel-2,root,localhost,4,0,DISCONNECT,test,TLSv1.3,0
      20250704 19:18:06,qa-roel-2,roel,localhost,5,0,CONNECT,test,TLSv1.3,0
      20250704 19:18:06,qa-roel-2,roel,localhost,5,8,QUERY,test,'show databases',0
      496 data/server_audit.log
      

      Additionally, as another example, if we execute in a frist client the following:

      INSTALL PLUGIN server_audit SONAME 'server_audit';
      SET GLOBAL server_audit_logging=ON;
      SET GLOBAL server_audit_file_buffer_size=8192;
      SELECT 1;   # Leave client connection open
      

      And then start a secondary client:

      ./bin/mariadb -S./socket.sock test  # Open a secondary client connection
      

      Here too the log is written prematurely:

      bb-12.0-mdev-34680x3-hf CS 12.0.1 8ead5a2a8a15a95f060e02d26c1ed28800fbdb03 (Optimized, Clang) Build 02/07/2025

      $ cat data/server_audit.log; wc -c data/server_audit.log
      20250704 19:21:13,qa-roel-2,root,localhost,4,4,QUERY,test,'SET GLOBAL server_audit_logging=ON',0
      20250704 19:21:13,qa-roel-2,root,localhost,4,5,QUERY,test,'SET GLOBAL server_audit_file_buffer_size=8192',0
      20250704 19:21:14,qa-roel-2,root,localhost,4,6,QUERY,test,'SELECT 1',0
      20250704 19:21:59,qa-roel-2,roel,localhost,5,0,CONNECT,test,TLSv1.3,0
      20250704 19:21:59,qa-roel-2,roel,localhost,5,7,QUERY,test,'show databases',0
      423 data/server_audit.log
      

      As we can see, new client connections trigger a Audit log write, and the server_audit_file_buffer_size size setting is not respected.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              Roel Roel Van de Paar
              Votes:
              0 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.