Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client/router: implement the query region gRPC client #8939

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

JmPotato
Copy link
Member

What problem does this PR solve?

Issue Number: ref #8690.

What is changed and how does it work?

Implement the router stream update logic.

Check List

Tests

  • Unit test
  • Integration test

Release note

None.

@JmPotato JmPotato added the component/client Client logic. label Dec 19, 2024
Copy link
Contributor

ti-chi-bot bot commented Dec 19, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 19, 2024
@JmPotato JmPotato force-pushed the query_region branch 2 times, most recently from 8e258ea to 292cdf2 Compare January 8, 2025 05:26
@JmPotato JmPotato changed the title client/router: implement the stream update logic client/router: implement the query region gRPC client Jan 8, 2025
@JmPotato JmPotato marked this pull request as ready for review January 8, 2025 05:27
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 8, 2025
@JmPotato JmPotato force-pushed the query_region branch 3 times, most recently from 59c7dbe to 48ff881 Compare January 22, 2025 03:50
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 62.60163% with 138 lines in your changes missing coverage. Please review.

Project coverage is 76.28%. Comparing base (6cadbe7) to head (7d6da81).
Report is 1 commits behind head on master.

❌ Your patch check has failed because the patch coverage (62.60%) is below the target coverage (74.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8939      +/-   ##
==========================================
+ Coverage   76.25%   76.28%   +0.02%     
==========================================
  Files         466      467       +1     
  Lines       70733    71084     +351     
==========================================
+ Hits        53938    54225     +287     
- Misses      13437    13485      +48     
- Partials     3358     3374      +16     
Flag Coverage Δ
unittests 76.28% <62.60%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@JmPotato JmPotato force-pushed the query_region branch 2 times, most recently from 4b253eb to 46fd376 Compare January 22, 2025 07:36
client/clients/router/client.go Show resolved Hide resolved
client/pkg/utils/timerutil/util.go Outdated Show resolved Hide resolved
leaderURL atomic.Value
// conCtxMgr is used to store the context of the router stream connection(s).
conCtxMgr *cctx.Manager[pdpb.PD_QueryRegionClient]
// updateConnectionCh is used to trigger the connection update actively.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should updateConnectionCh be part of conCtxMgr?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client controls connection updating with the URL change, and conCtxMgr works more like a storage layer for the connections. It seems there is no particular reason to put the update notifications in there.

Signed-off-by: JmPotato <[email protected]>
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 24, 2025
Copy link
Contributor

ti-chi-bot bot commented Jan 24, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-01-24 15:04:53.932066744 +0000 UTC m=+452421.262986149: ☑️ agreed by rleungx.

Copy link
Contributor

ti-chi-bot bot commented Jan 24, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rleungx

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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 added the approved label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved component/client Client logic. dco-signoff: yes Indicates the PR's author has signed the dco. needs-1-more-lgtm Indicates a PR needs 1 more LGTM. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants