ruv2: align bypass with ru v1#1926
Conversation
Signed-off-by: disksing <i@disksing.com> (cherry picked from commit 26d927f)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a request-derived Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant ResourceControl
participant TiKV_RPC as tikvrpc
participant Config
Client->>ResourceControl: MakeRequestInfo(req).Bypass()
ResourceControl-->>Client: bypass (true/false)
Client->>TiKV_RPC: send request (include Bypass for streams)
alt Non-stream / response arrives
TiKV_RPC-->>Client: resp (may be nil)
alt resp != nil and bypass == false
Client->>Config: UpdateTiKVRUV2FromExecDetailsV2(ctx, execDetails, 0)
else
Note right of Client: Skip RU v2 update
end
else Coprocessor stream
TiKV_RPC->>TiKV_RPC: CopStreamResponse.Bypass = bypass
loop Recv messages
TiKV_RPC-->>Config: if !Bypass then UpdateTiKVRUV2FromExecDetailsV2(ctx, execDetails, 0)
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ekexium, nolouch 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 |
Summary
RequestInfoWhy
RU v2 bypass conditions had become broader than the existing resource control bypass rules by also skipping background requests. This change aligns the RU v2 bypass behavior with the existing request-info bypass semantics.
Testing
go test ./internal/client -run 'TestBypassRUV2FollowsRequestInfoBypass|TestSendRequestAsyncUpdateTiKVRUV2'go test ./tikvrpc -run TestCopStreamResponseRecvBypassRUV2go test ./internal/resourcecontrol -run TestMakeRequestInfoSummary by CodeRabbit
Bug Fixes
Tests