Some audit logs has `CONNECTION_ID=0`
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
1. set up a cluster with enterprise version
2. login with wrong password
### 2. What did you expect to see? (Required)
All audit logs should have a `CONNECTION_ID` entry with a non-zero id.
### 3. What did you see instead (Required)
We found a audit log with `CONNECTION_ID=0`
```
[2024/12/31 18:15:46.305 +08:00] [INFO] [ID=16b97472-796e-46d8-a111-a52b4a8b4646-0002] [EVENT="[CONNECTION,CONNECT]"] [USER=root] [ROLES="[]"] [CONNECTION_ID=2097164] [SESSION_ALIAS=] [TABLES="[]"] [STATUS_CODE=0] [REASON="[privilege:1045]Access denied for user 'root'@'127.0.0.1' (using password: YES)"] [CURRENT_DB=test] [CONNECTION_TYPE=TCP] [PID=55072] [SERVER_VERSION=v8.4.0-this-is-a-placeholder] [SSL_VERSION=] [HOST_IP=127.0.0.1] [HOST_PORT=4001] [CLIENT_IP=127.0.0.1] [CLIENT_PORT=59268] [AUTH_METHOD=mysql_native_password] [CONN_ATTRS="{\"_client_name\":\"pymysql\",\"_client_version\":\"1.1.1\",\"_pid\":\"71856\",\"program_name\":\"mycli\"}"]
[2024/12/31 18:15:46.306 +08:00] [INFO] [ID=16b97472-796e-46d8-a111-a52b4a8b4646-0003] [EVENT="[CONNECTION,DISCONNECT]"] [USER=root] [ROLES="[]"] [CONNECTION_ID=0] [SESSION_ALIAS=] [TABLES="[]"] [STATUS_CODE=1] [CONNECTION_TYPE=TCP] [PID=55072] [SERVER_VERSION=v8.4.0-this-is-a-placeholder] [SSL_VERSION=] [HOST_IP=127.0.0.1] [HOST_PORT=4001] [CLIENT_IP=127.0.0.1] [CLIENT_PORT=59268] [AUTH_METHOD=mysql_native_password] [CONN_ATTRS="{\"_client_name\":\"pymysql\",\"_client_version\":\"1.1.1\",\"_pid\":\"71856\",\"program_name\":\"mycli\"}"]
```
### 4. What is your TiDB version? (Required)
Contributor guide
Assessment
This issue has not been assessed yet.