-
Notifications
You must be signed in to change notification settings - Fork 721
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
tso, election: remove some unnecessary logs from the TSO hot path #4044
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: JmPotato <ghzpotato@gmail.com>
@@ -166,10 +164,6 @@ func (s *Server) Tso(stream pdpb.PD_TsoServer) error { | |||
return status.Errorf(codes.Unknown, err.Error()) | |||
} | |||
|
|||
elapsed := time.Since(start) | |||
if elapsed > slowThreshold { | |||
log.Warn("get timestamp too slow", zap.Duration("cost", elapsed)) |
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.
Why is it useless?
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.
I think we can get it from the metrics also.
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.
I don't find any metrics to record it.
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.
Oh, you mean tsoHandleDuration.Observe(time.Since(start).Seconds())
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.
Yes.
@@ -362,7 +362,6 @@ func (t *timestampOracle) getTS(leadership *election.Leadership, count uint32, s | |||
if currentPhysical == typeutil.ZeroTime { | |||
// If it's leader, maybe SyncTimestamp hasn't completed yet | |||
if leadership.Check() { | |||
log.Info("this PD is a new leader, but sync hasn't been completed yet, wait for a while") |
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.
also this log will be noise:
[2021/06/18 16:15:19.627 +08:00] [ERROR] [tso.go:302] ["invalid timestamp"] [timestamp={}]
[2021/06/18 16:15:19.628 +08:00] [ERROR] [tso.go:302] ["invalid timestamp"] [timestamp={}]
[2021/06/18 16:15:19.628 +08:00] [ERROR] [tso.go:302] ["invalid timestamp"] [timestamp={}]
[2021/06/18 16:15:19.685 +08:00] [ERROR] [tso.go:302] ["invalid timestamp"] [timestamp={}]
[2021/06/18 16:15:19.686 +08:00] [ERROR] [tso.go:302] ["invalid timestamp"] [timestamp={}]
[2021/06/18 16:15:19.718 +08:00] [ERROR] [tso.go:302] ["invalid timestamp"] [timestamp={}]
[2021/06/18 16:15:19.718 +08:00] [ERROR] [tso.go:302] ["invalid timestamp"] [timestamp={}]
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.
Removed. PTAL.
Codecov Report
@@ Coverage Diff @@
## master #4044 +/- ##
==========================================
- Coverage 74.47% 74.45% -0.02%
==========================================
Files 257 257
Lines 25980 25972 -8
==========================================
- Hits 19349 19338 -11
+ Misses 4898 4896 -2
- Partials 1733 1738 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: JmPotato <ghzpotato@gmail.com>
f998947
to
a443374
Compare
Signed-off-by: JmPotato <ghzpotato@gmail.com>
/run-unit-test |
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
/merge |
@rleungx: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 337f78d
|
/run-unit-test |
…kv#4044) * Remove some unnecessary logs from the TSO hot path Signed-off-by: JmPotato <ghzpotato@gmail.com> * Remove more unnecessary logs Signed-off-by: JmPotato <ghzpotato@gmail.com> * Fix the test Signed-off-by: JmPotato <ghzpotato@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Signed-off-by: JmPotato ghzpotato@gmail.com
What problem does this PR solve?
Remove some unnecessary logs from the TSO hot path.
This indicator can be observed through metrics, so it is not necessary to hit the log here.
In past experience, this log has not been very helpful and may be very noisy.
Ditto.
What is changed and how it works?
Remove some unnecessary logs from the TSO hot path.
Check List
Tests
Release note