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

Merged
merged 5 commits into from
Jan 27, 2025

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.23%. Comparing base (2a1f2dc) to head (ad46228).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8939      +/-   ##
==========================================
- Coverage   76.26%   76.23%   -0.04%     
==========================================
  Files         466      467       +1     
  Lines       70750    71101     +351     
==========================================
+ Hits        53961    54201     +240     
- Misses      13425    13512      +87     
- Partials     3364     3388      +24     
Flag Coverage Δ
unittests 76.23% <62.60%> (-0.04%) ⬇️

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
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
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 <ghzpotato@gmail.com>
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jan 24, 2025
@ti-chi-bot ti-chi-bot bot added the lgtm label Jan 27, 2025
Copy link
Contributor

ti-chi-bot bot commented Jan 27, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nolouch, 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 removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 27, 2025
Copy link
Contributor

ti-chi-bot bot commented Jan 27, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-01-24 15:04:53.932066744 +0000 UTC m=+452421.262986149: ☑️ agreed by rleungx.
  • 2025-01-27 12:36:53.16608447 +0000 UTC m=+702740.497003871: ☑️ agreed by nolouch.

@ti-chi-bot ti-chi-bot bot merged commit debceaf into tikv:master Jan 27, 2025
23 of 25 checks passed
@JmPotato JmPotato deleted the query_region branch January 27, 2025 14:44
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. 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.

3 participants