store: mark TiDB requests for max-ts validation - #68779
Conversation
|
Skipping CI for Draft Pull Request. |
|
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 (1)
📝 WalkthroughWalkthroughThe PR marks TiDB-originated TiKV requests as RequestOriginTiDB: Bazel deps added, server startup sets the default request origin, and tests assert the origin is present across several RPC request types. ChangesRequest Origin Identification
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 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)
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 |
|
Skipping CI for Draft Pull Request. |
07f1963 to
f2ec167
Compare
f2ec167 to
0bf1fe0
Compare
3003007 to
145967c
Compare
Signed-off-by: Ziqian Qin <eke@fastmail.com>
145967c to
bc2bc07
Compare
Signed-off-by: Ziqian Qin <eke@fastmail.com>
Signed-off-by: Ziqian Qin <eke@fastmail.com>
|
@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. |
There was a problem hiding this comment.
Pull request overview
This PR marks TiDB-originated TiKV requests by setting a process-wide default kvrpcpb.Context.request_origin to RequestOriginTiDB, and extends an existing unit test to assert the origin is carried on the wire. It also bumps kvproto and client-go versions (and the Bazel deps metadata) to pick up the required proto/client changes.
Changes:
- Set
tikvrpcprocess default request origin toRequestOriginTiDBintidb-server. - Extend
TestRequestSourceto assertrequest_originis set for various RPC types. - Bump
github.com/pingcap/kvprotoandgithub.com/tikv/client-go/v2versions (Go modules + Bazelgo_repository).
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/session/test/session_test.go | Extends request-source test to also validate request_origin propagation; sets/reset default origin within the test. |
| cmd/tidb-server/main.go | Sets the process default TiKV request origin to TiDB at startup. |
| cmd/tidb-server/BUILD.bazel | Adds Bazel deps for new imports (kvrpcpb, tikvrpc). |
| go.mod | Bumps kvproto and client-go module versions. |
| go.sum | Updates sums for the bumped kvproto and client-go versions. |
| DEPS.bzl | Updates Bazel go_repository pins (strip_prefix/sha256/urls) for kvproto and client-go. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@go.mod`:
- Line 104: The go.mod references a non-resolvable pseudo-version for
github.com/tikv/client-go/v2 (v2.0.8-0.20260601085006-f2ffb0f83e51) which causes
module fetches to 404; fix it by either replacing that pseudo-version with a
proxy-resolvable tag (bump to an official v2.x release) or add an explicit
replace directive for github.com/tikv/client-go/v2 pointing to the correct
fork/commit URL that contains commit f2ffb0f83e51 so go list/go build can fetch
it; update the go.mod entry for github.com/tikv/client-go/v2 accordingly and run
go mod tidy to validate.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: daf611b9-2fde-4823-91b4-c388d5345f15
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (5)
DEPS.bzlcmd/tidb-server/BUILD.bazelcmd/tidb-server/main.gogo.modpkg/session/test/session_test.go
|
/retest |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #68779 +/- ##
================================================
- Coverage 76.3157% 75.1788% -1.1370%
================================================
Files 2041 2026 -15
Lines 562986 568454 +5468
================================================
- Hits 429647 427357 -2290
- Misses 132425 141050 +8625
+ Partials 914 47 -867
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/retest |
…quest-origin-tidb
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cfzjywxk, zyguan The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…quest-origin-tidb # Conflicts: # DEPS.bzl # go.mod # go.sum
Signed-off-by: Ziqian Qin <eke@fastmail.com>
|
/cherry-pick release-8.5 |
|
@ekexium: new pull request created to branch DetailsIn response to this:
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. |
What problem does this PR solve?
Issue Number: close #68799
Problem Summary:
TiKV needs to distinguish TiDB-originated requests from other client-go users so selected non-TiDB max-ts update paths can be validated without drift tolerance.
What changed and how does it work?
REQUEST_ORIGIN_TIDBfromcmd/tidb-server.TestRequestSourceto verify TiDB requests carrykvrpcpb.Context.request_originon the wire.replacedirectives so this draft can compile before upstream dependency PRs merge.The temporary dependency replaces should be removed after pingcap/kvproto#1479 and tikv/client-go#1975 are merged and TiDB can bump normal upstream module versions.
Check List
Tests
Commands:
make bazel_prepareGOPRIVATE=github.com/ekexium/kvproto,github.com/ekexium/client-go ./tools/check/failpoint-go-test.sh pkg/session/test -run TestRequestSourceGOPRIVATE=github.com/ekexium/kvproto,github.com/ekexium/client-go gotestsum --format short-verbose -- ./cmd/tidb-server -run '^$'GOPRIVATE=github.com/ekexium/kvproto,github.com/ekexium/client-go make lintgit diff --checkSide effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit
Chores
Tests