-
Notifications
You must be signed in to change notification settings - Fork 753
server,tests: add server tso batch metric and test lock fix #10224
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
base: master
Are you sure you want to change the base?
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
📝 WalkthroughWalkthroughAdds a server-side TSO batch-size histogram and records observations on local TSO handling; updates Grafana queries to use server-side metrics; introduces a new TestServer "Starting" state and updates Run/Stop/Destroy and retry cleanup logic accordingly. Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10224 +/- ##
==========================================
+ Coverage 78.63% 78.80% +0.16%
==========================================
Files 520 522 +2
Lines 70089 70371 +282
==========================================
+ Hits 55112 55453 +341
+ Misses 10989 10923 -66
- Partials 3988 3995 +7
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
17d03d8 to
62cda4f
Compare
62cda4f to
cd65fef
Compare
Signed-off-by: okjiang <819421878@qq.com>
cd65fef to
91fcabc
Compare
This reverts commit 91fcabc. Signed-off-by: okjiang <819421878@qq.com>
Signed-off-by: okjiang <819421878@qq.com>
a22494d to
2013ce2
Compare
Signed-off-by: okjiang <819421878@qq.com>
|
/retest |
What problem does this PR solve?
pd-tso-benchcan generate batch requests, but the existing Grafana panel depends on the client-side metricpd_client_request_handle_tso_batch_size. In stress scenarios this client metric may be missing or not representative, which makes it hard to judge real server-side batching behavior from PD monitoring.In addition, CI hit an intermittent deadlock warning in tests:
tests.TestServer.Run()held a write lock while callings.server.Run(), while retry cleanup paths calledState()under a read lock, causing lock contention and flaky failures.Issue Number: ref #10228
What is changed and how does it work?
This PR changes observability to use PD server metrics directly and fixes the test lock contention:
pd_server_handle_tso_batch_sizeinserver/metrics.go.request.GetCount()for normal TSO handling and service-independent forwarding path inserver/grpc_service.go.TSO request batch sizeinmetrics/grafana/pd.jsonto query the new server metric (_bucket/_sum/_count) instead of client metric.tests/cluster.goby introducing aStartingstate and avoiding holdingTestServerwrite lock acrosss.server.Run(). Cleanup logic now treatsStartingas active and can stop/destroy safely.Check List
Tests
Manual test steps:
Code changes
Side effects
Related changes
pingcap/docs/pingcap/docs-cn: N/Apingcap/tiup: N/ARelease note
Summary by CodeRabbit