Skip to content

tikvrpc: add default request origin (#1975) - #1978

Merged
ti-chi-bot[bot] merged 1 commit into
tikv:tidb-8.5from
ti-chi-bot:cherry-pick-1975-to-tidb-8.5
Jun 8, 2026
Merged

tikvrpc: add default request origin (#1975)#1978
ti-chi-bot[bot] merged 1 commit into
tikv:tidb-8.5from
ti-chi-bot:cherry-pick-1975-to-tidb-8.5

Conversation

@ti-chi-bot

Copy link
Copy Markdown
Member

This is an automated cherry-pick of #1975

What changed

  • Add a process-wide default request origin in tikvrpc.
  • Fill kvrpcpb.Context.request_origin from that default when creating or attaching request context.
  • Keep the default as unspecified so non-TiDB client-go users do not get TiDB trust by accident.

Dependency stack

Tests

  • gotestsum --format short-verbose -- ./tikvrpc
  • go test ./tikvrpc -run '^TestDefaultRequestOrigin$' -race
  • cd integration_tests && go list -mod=readonly ./...
  • for mod in $(find examples -name go.mod -print | sort); do (cd "${mod%/go.mod}" && go list -mod=readonly ./...); done
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Configurable default request origin for RPCs, ensuring consistent request identification and tracking across operations.
  • Chores

    • Bumped an indirect dependency used by examples and integration tests to a newer commit across multiple modules.
  • Tests

    • Added unit tests to verify default request origin behavior and that explicit origins are preserved across RPC creation and attachment.

@ti-chi-bot ti-chi-bot added dco-signoff: yes Indicates the PR's author has signed the dco. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-tidb-8.5 labels Jun 1, 2026
@ti-chi-bot

Copy link
Copy Markdown
Member Author

@ekexium This PR has conflicts, I have hold it.
Please resolve them or ask others to resolve them, then comment /unhold to remove the hold label.

@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 482bb221-c689-4eb9-83b7-aa7e0b3b862d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ekexium
ekexium force-pushed the cherry-pick-1975-to-tidb-8.5 branch from 48392d0 to 992d13d Compare June 8, 2026 06:28
ref pingcap/tidb#68799

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: Ziqian Qin <eke@fastmail.com>
@ekexium
ekexium force-pushed the cherry-pick-1975-to-tidb-8.5 branch from 992d13d to 00e56d4 Compare June 8, 2026 06:29
@ekexium ekexium removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 8, 2026
@ekexium
ekexium requested review from cfzjywxk and zyguan June 8, 2026 06:51
@ti-chi-bot ti-chi-bot Bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jun 8, 2026
@ti-chi-bot ti-chi-bot Bot added the lgtm label Jun 8, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jun 8, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2026-06-08 06:56:02.610960656 +0000 UTC m=+770263.681278046: ☑️ agreed by cfzjywxk.
  • 2026-06-08 07:59:40.281439327 +0000 UTC m=+774081.351756727: ☑️ agreed by zyguan.

@ti-chi-bot
ti-chi-bot Bot merged commit ddfbdda into tikv:tidb-8.5 Jun 8, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-tidb-8.5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants