-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
executor: add metric to trace tikvTxn LockKeys time consume #14189
Conversation
LGTM |
metrics/tikvclient.go
Outdated
Namespace: "tidb", | ||
Subsystem: "tikvclient", | ||
Name: "pessimistic_lock_keys_duration", | ||
Buckets: prometheus.ExponentialBuckets(0.001, 2, 30), // 1ms ~ 1073741s |
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.
The buckets can fewer.
@jackysp PTAL |
Namespace: "tidb", | ||
Subsystem: "tikvclient", | ||
Name: "pessimistic_lock_keys_duration", | ||
Buckets: prometheus.ExponentialBuckets(0.001, 2, 24), // 1ms ~ 16777s |
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.
Do we need the max to 16777s
?
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.
The innodb_lock_wait_timeout
session variable could be set to maximum 1073741824
seconds, so maybe it could be some big value
defer func() { | ||
if err == nil { | ||
if lockCtx.PessimisticLockWaited > 0 { | ||
lockCtx.LockTimeWaited = time.Since(lockCtx.WaitStartTime) |
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.
Seems the field LockTimeWaited
is unnecessary.
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.
This is used for slow query logging in the diff part2
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.
Reset LGTM
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.
LGTM
/run-all-tests |
cherry pick to release-3.0 failed |
/run-cherry-picker |
cherry pick to release-3.0 in PR #14204 |
What problem does this PR solve?
Add metric to trace pessimistic lock
LockKeys
time consumeWhat is changed and how it works?
Check List
Tests
Code changes
Side effects
Related changes
tidb-ansible
repositoryRelease note