Yukang-Lian opened a new pull request, #61621: URL: https://github.com/apache/doris/pull/61621
## Summary - When `enable_prepared_stmt_audit_log = false` (default), `auditAfterExec()` is entirely skipped for prepared statements. Since QPS metric counting (`COUNTER_QUERY_ALL`, `COUNTER_QUERY_ERR`, `HISTO_QUERY_LATENCY`, etc.) lives inside `AuditLogHelper.logAuditLog()`, these metrics are also lost for prepared statement SELECT queries. - Add `AuditLogHelper.updateMetrics()` to count metrics independently of audit log writing, and call it in the `else` branch when audit log is disabled. - This decouples the metric counting from audit log writing without modifying the existing `logAuditLogImpl()` logic. ## Changes - **AuditLogHelper.java**: Add `updateMetrics()` + `updateMetricsImpl()` methods for standalone metric counting with `enable_bdbje_debug_mode` short-circuit and catch-all exception isolation (matching `auditAfterExec` protection semantics). - **MysqlConnectProcessor.java**: Add `else` branch in `handleExecute()` to call `updateMetrics()` when audit log is disabled. - **AuditLogHelperTest.java**: Unit tests covering OK query, ERR query, non-query (INSERT), and debug mode short-circuit scenarios. ## Test plan - [x] Unit tests pass (`AuditLogHelperTest` - 4 cases) - [ ] Existing regression tests pass (`insert_group_commit_with_prepare_stmt.groovy`) 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
