Skip to content

client: use batch-level runtime trace regions#11012

Open
bb7133 wants to merge 1 commit into
tikv:release-8.5-20260323-v8.5.5from
bb7133:bb7133/fix-batched-runtime-trace-regions-release-8.5-20260323
Open

client: use batch-level runtime trace regions#11012
bb7133 wants to merge 1 commit into
tikv:release-8.5-20260323-v8.5.5from
bb7133:bb7133/fix-batched-runtime-trace-regions-release-8.5-20260323

Conversation

@bb7133

@bb7133 bb7133 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: ref #10965

Cherry-pick #10965 to release-8.5-20260323-v8.5.5. This reduces Go runtime trace region overhead by using a batch-level TSO request send region.

What is changed and how does it work?

This backport changes TSO dispatcher tracing from one pdclient.tsoReqSend region per request to one pdclient.tsoReqSendBatch region per processed batch.

Conflict note: the original master PR also touched client/clients/router/client.go, but that router client path does not exist in this release branch, so that part is not applicable here. The final backport only changes client/tso_dispatcher.go.

Check List

Tests:

  • git diff --check origin/release-8.5-20260323-v8.5.5...HEAD
  • cd client && go test ./... -run '^$' -count=1
  • cd client && go test . -run 'TestTSODispatcherTestSuite/TestBasic' -count=1
  • cd client && go test . -run 'TestTSODispatcherTestSuite/TestBatchDelaying' -count=1
  • cd client && go test . -run 'TestTSODispatcherTestSuite/TestBatchDelaying' -count=1 -trace /tmp/pdclient-tso-batch-20260323.trace and verified the trace contains pdclient.tsoReqSendBatch

Release note

None

Signed-off-by: bb7133 <bb7133@gmail.com>
(cherry picked from commit 37bbe3e)
@ti-chi-bot ti-chi-bot Bot added dco-signoff: yes Indicates the PR's author has signed the dco. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jul 16, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign rleungx for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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

@coderabbitai

coderabbitai Bot commented Jul 16, 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: 94ce486a-b977-4780-9997-81ec065c4710

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.

@ti-chi-bot ti-chi-bot Bot added the contribution This PR is from a community contributor. label Jul 16, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Hi @bb7133. Thanks for your PR.

I'm waiting for a tikv member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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 kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot Bot added needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jul 16, 2026
@bb7133

bb7133 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

CI update:

Most relevant checks are green:

  • statics
  • tso-function-test
  • chunks (7, Client Integration Test)
  • chunks (9, MicroService Integration(!TSO))

The failed run is PD Test / chunks (3, Unit Test(3)), and other shards were cancelled after that. The failure is in server/api TestRegionCPUUsageCompatibility: the test itself passed, but goleak found leftover TSO/etcd retry goroutines after server shutdown. This does not touch the changed path in this backport (client/tso_dispatcher.go), and I could not reproduce it locally:

go test ./server/api -run TestRegionCPUUsageCompatibility -count=1

The PR change is still limited to replacing per-request pdclient.tsoReqSend runtime trace regions with the batch-level pdclient.tsoReqSendBatch region in client/tso_dispatcher.go.

I tried to rerun the failed GitHub Actions jobs, but my token does not have repo admin permission:

run 29467474896 cannot be rerun; Must have admin rights to Repository.

Could a maintainer help rerun the failed jobs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution This PR is from a community contributor. dco-signoff: yes Indicates the PR's author has signed the dco. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant