-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add log #16831
add log #16831
Conversation
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Reviewer Guide 🔍
|
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Code Suggestions ✨
|
pkg/frontend/util.go
Outdated
if status == success { | ||
ses.Debug(ctx, "query trace status", logutil.StatementField(str), logutil.StatusField(status.String())) | ||
ses.Debug(ctx, "query trace status", logutil.StatementField(str), logutil.StatusField(status.String()), logutil.TxnIdField(txnInfo)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
默认是Info级别。Debug接口不回打印任何日志的。
改为info后,打印会非常多。
要判断确定sql才能改为info。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加了
@@ -337,8 +338,10 @@ type FeSession interface { | |||
ResetFPrints() | |||
EnterFPrint(idx int) | |||
ExitFPrint(idx int) | |||
SetStaticTxnId(id []byte) | |||
GetStaticTxnId() uuid.UUID | |||
//SetStaticTxnId(id []byte) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要都删掉吧。
@@ -504,12 +511,16 @@ func (th *TxnHandler) commitUnsafe(execCtx *ExecCtx) error { | |||
if th.txnOp != nil { | |||
execCtx.ses.EnterFPrint(79) | |||
defer execCtx.ses.ExitFPrint(79) | |||
commitTs := th.txnOp.Txn().CommitTS | |||
execCtx.ses.SetTxnId(th.txnOp.Txn().ID) | |||
//commitTs := th.txnOp.Txn().CommitTS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要了,都删掉吧。
User description
What type of PR is this?
Which issue(s) this PR fixes:
issue #16273
What this PR does / why we need it:
1.Add log
PR Type
Bug fix, Enhancement
Description
SetStaticTxnId
andGetStaticTxnId
methods withSetStaticTxnInfo
andGetStaticTxnInfo
to store and retrieve transaction debug information.Changes walkthrough 📝
mysql_cmd_executor.go
Update transaction information storage method
pkg/frontend/mysql_cmd_executor.go
SetStaticTxnId
toSetStaticTxnInfo
to store transaction debuginformation.
txn.go
Add logging for transaction commits and update transaction info
handling
pkg/frontend/txn.go
types.go
Replace static transaction ID methods with transaction info methods
pkg/frontend/types.go
SetStaticTxnId
andGetStaticTxnId
withSetStaticTxnInfo
andGetStaticTxnInfo
.txnInfo
to store transaction debug information.util.go
Update logging to use transaction debug information
pkg/frontend/util.go
transaction ID.