Hi Percona Support Team,
I am testing the audit_log_filter component of Percona MySQL 8.4.7 on a 3-node MySQL InnoDB Cluster (Group Replication) setup and have observed inconsistent behavior between the primary and replica nodes.
Environment
-
Database Version: MySQL CE 8.4.7
-
Topology: 3-node MySQL InnoDB Cluster (Group Replication)
-
Audit Log Filter Component:
audit_log_filtercomponent from Percona MySQL 8.4.7
Configuration
The audit filter rule is created and assigned as follows:
MySQL localhost:3306 ssl SQL > SELECT * FROM mysql.audit_log_filter;
+-----------+---------+---------------------------------------------------------------------------------------------------------------------------------+
| filter_id | name | filter |
+-----------+---------+---------------------------------------------------------------------------------------------------------------------------------+
| 1 | log_ddl | {"filter": {"rule": {"log": true, "event_class": "query", "command_class": ["create", "alter", "drop", "truncate", "rename"]}}} |
+-----------+---------+---------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.0005 sec)
MySQL localhost:3306 ssl SQL > SELECT * FROM mysql.audit_log_user;
+----------+----------+------------+
| username | userhost | filtername |
+----------+----------+------------+
| % | % | log_ddl |
+----------+----------+------------+
1 row in set (0.0006 sec)
MySQL localhost:3306 ssl SQL > select audit_log_session_filter_id();
+-------------------------------+
| audit_log_session_filter_id() |
+-------------------------------+
| 1 |
+-------------------------------+
Observed Behavior
-
On the primary node, DDL operations are correctly captured in the audit log.
-
On the replica nodes, no audit entries are generated even though:
-
The component is installed
-
The filter rules exist
-
The filter is assigned to the user (
%) -
The
mysql.audit_log_filterandmysql.audit_log_usertables are replicated.
-
Additional Observation
When attempting to reload the filters on the replica:
SELECT audit_log_filter_flush();
The following error is returned:
ERROR: Could not reinitialize audit log filters
Expected Behavior
Since the filter metadata tables are replicated across the cluster, the audit plugin on replica nodes should load the filters and log the relevant events locally.
Actual Behavior
Replica nodes do not generate audit logs despite having the filter configuration present.