*: refine the logs of TiDB #24698
Labels
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
sig/sql-infra
SIG: SQL Infra
type/enhancement
The issue or PR belongs to an enhancement.
The annoyance
The logs of TiDB are verbose and annoying, in my mind, it is partially due to the fact that: (1) we don't want to lose any detail, even when it is hardly useful. (2) we didn't pay much attention to them.
Give a possible example, a simple
ERROR 1046 (3D000): No database selected
error likeMake 2 long annoying entries in TiDB log:
It is annoying for at least 2 reasons: (1) We don't need the stack at all because the cause is clear enough. (2) The stack is too long because the full path of the source code is given, which is obviously unnecessary.
The proposal
IMO we can try to refine the logs of TiDB by:
ERROR 1046: No database selected
,ERROR 1064: Error in SQL syntax
).go build --trim
with the plugin(plugin: spurious version-mismatch error for packages that differ only in debug information golang/go#31278 (comment)), it is still possible to trim them without the built-in mechanism of Golang.logutil.BgLogger
tologutil.Logger(ctx)
#15638 and Print Txn ID and Query ID in log to trace the whole lifetime of a Txn / SQL #17845The text was updated successfully, but these errors were encountered: