The content of the slow log does not match the source code expectations

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: slow log日志内容与源码预期不符

| username: 比特鱼-54

【TiDB Usage Environment】Production Environment
【TiDB Version】v4.0.0
【TiDashBoard Version】v4.0.0
【Reproduction Path】
【Encountered Problem: Problem Phenomenon and Impact】
How to configure so that the content formatted by the SlowLogFormat function can be fully output to the slow log file?
【Resource Configuration】
【Attachment: Screenshot/Log/Monitoring】

Where did information like KV_total and PD_total go?

| username: 我是咖啡哥 | Original post link

It seems that there are no parameters to control formatting.
The main parameters related to slow SQL are as follows:

| username: Jiawei | Original post link

Just a quick question: Does the source code version you are looking at match your data version? I couldn’t find this section in the 4.0.0 source code.

| username: 比特鱼-54 | Original post link

I am looking at the release-4.0 code:

Which branch are you on?

| username: 比特鱼-54 | Original post link

Yes, that’s exactly what I find strange.
In theory, this function is responsible for formatting slow queries, so there’s no reason for it to skip the middle part.

| username: Jiawei | Original post link

I directly pulled a 4.0.0 source code package here

| username: Jiawei | Original post link

This is also fine.

| username: 比特鱼-54 | Original post link

I know what the problem is, the code version is incorrect :sweat:

| username: Jiawei | Original post link

Congratulations on successfully resolving the issue.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.