client: use batch-level runtime trace regions (#10965) - #11062
Conversation
close tikv#10964 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
[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 |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
This is an automated cherry-pick of #10965
What problem does this PR solve?
Issue Number: Close #10964
Batched PD client requests currently start one Go runtime trace region per request on the same dispatcher goroutine. Runtime trace regions are goroutine-local and must be nested in LIFO order, so representing batched requests as overlapping per-request regions can make
go tool tracefail with errors like:This can make Go trace timeline and derived pprof outputs unusable during production diagnosis.
What is changed and how does it work?
Use one batch-level runtime trace region for each batched send path, while preserving per-request opentracing spans:
pdclient.tsoReqSendruntime regions with onepdclient.tsoReqSendBatchregion in the TSO dispatcher.pdclient.regionReqSendruntime regions with onepdclient.regionReqSendBatchregion in the region router client.Check List
Tests
Code changes
Side effects
Related changes
pingcap/docs/pingcap/docs-cn: Nonepingcap/tiup: NoneRelease note
Summary by CodeRabbit