*: fix gRPC request source fields#68301
Conversation
|
@ekexium I've received your pull request and will start the review. I'll conduct a thorough review covering code quality, potential issues, and implementation details. ⏳ This process typically takes 10-30 minutes depending on the complexity of the changes. ℹ️ Learn more details on Pantheon AI. |
|
[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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (15)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (12)
📝 WalkthroughWalkthroughAdds a new split client ChangesAdd RequestSource Metadata to TiKV RPC Requests
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Command failed 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 |
There was a problem hiding this comment.
Pull request overview
This PR improves request attribution/diagnostics by ensuring various internal TiDB/BR/Lightning/DDL/GC TiKV gRPC requests consistently populate kvrpcpb.Context.RequestSource, aligning with issue #33963’s goal of distinguishing internal vs external workload.
Changes:
- Add
RequestSourceto multiple internal TiKV RPCs (GC, DDL flashback, MVCC helper, lock-wait info, TiFlash batch cop). - Plumb a configurable request source through BR’s region split client and set it from BR/Lightning call sites.
- Set request source on BR test utilities and Lightning local backend split client creation.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/store/helper/helper.go | Sets RequestSource for MVCC helper RPCs (MvccGetByKey, MvccGetByStartTs). |
| pkg/store/gcworker/gc_worker.go | Sets RequestSource for GC and unsafe destroy range requests. |
| pkg/store/driver/tikv_driver.go | Sets RequestSource for CmdLockWaitInfo requests. |
| pkg/store/copr/batch_coprocessor.go | Propagates request source into TiFlash batch cop requests. |
| pkg/lightning/backend/local/local.go | Sets request source on the BR split client used by Lightning local backend. |
| pkg/ddl/cluster.go | Sets RequestSource for flashback prepare/execute RPCs. |
| br/tests/br_key_locked/locker.go | Tags BR test prewrite requests with BR request source. |
| br/pkg/restore/split/client.go | Adds optional request-source plumbing into split client and attaches it to SplitRegion RPC context. |
| br/pkg/restore/snap_client/tikv_sender.go | Configures split client request source for BR restore splitting. |
| br/pkg/restore/snap_client/placement_rule_manager.go | Configures split client request source used by placement rule manager tooling. |
| br/pkg/restore/snap_client/client.go | Configures split client request source during restore client initialization. |
| br/pkg/restore/log_client/import.go | Sets RequestSource in ApplyKVFile request context. |
| br/pkg/restore/log_client/client.go | Configures split clients with BR request source in log restore flows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #68301 +/- ##
================================================
+ Coverage 77.7288% 78.6994% +0.9706%
================================================
Files 1990 2003 +13
Lines 551970 560230 +8260
================================================
+ Hits 429040 440898 +11858
+ Misses 122010 117240 -4770
- Partials 920 2092 +1172
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Signed-off-by: Ziqian Qin <eke@fastmail.com>
b5d0f47 to
3f7d233
Compare
|
/retest |
|
@ekexium: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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 kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: ref #33963
Problem Summary:
Fix some missing grpc request source fields
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit