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: introduce the connection ctx manager #8940

Merged
merged 4 commits into from
Dec 27, 2024

Conversation

JmPotato
Copy link
Member

What problem does this PR solve?

Issue Number: ref #8690.

What is changed and how does it work?

Previously, we used a `sync.Map` as a medium to propagate connection ctx updates between
the dispatcher and TSO client, which introduced a lot of redundant parameter passing and
made the logic less intuitive. This PR implements the same functionality using a common
connection ctx manager to simplify and reuse related code.

Check List

Tests

  • Unit test
  • Integration test

Release note

None.

@JmPotato JmPotato added the component/client Client logic. label Dec 19, 2024
@ti-chi-bot ti-chi-bot bot added 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 19, 2024
@JmPotato JmPotato force-pushed the reduce_member_update branch from 3a92119 to 9a6c85f Compare December 19, 2024 15:09
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 94.28571% with 10 lines in your changes missing coverage. Please review.

Project coverage is 76.24%. Comparing base (4d8009d) to head (f84cf99).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8940      +/-   ##
==========================================
- Coverage   76.28%   76.24%   -0.04%     
==========================================
  Files         463      464       +1     
  Lines       70474    70516      +42     
==========================================
+ Hits        53760    53767       +7     
- Misses      13368    13395      +27     
- Partials     3346     3354       +8     
Flag Coverage Δ
unittests 76.24% <94.28%> (-0.04%) ⬇️

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

@JmPotato JmPotato force-pushed the reduce_member_update branch from 9a6c85f to f39ad8c Compare December 23, 2024 07:46
@JmPotato JmPotato requested review from okJiang and rleungx December 23, 2024 07:48
@JmPotato
Copy link
Member Author

@rleungx @okJiang PTAL, thx!

client/clients/tso/client.go Outdated Show resolved Hide resolved
client/pkg/connectionctx/manager.go Show resolved Hide resolved
@JmPotato JmPotato requested a review from rleungx December 24, 2024 10:42
@JmPotato JmPotato force-pushed the reduce_member_update branch from 0eb408a to 192f36e Compare December 25, 2024 08:31
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Dec 25, 2024
Copy link
Member

@okJiang okJiang left a comment

Choose a reason for hiding this comment

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

rest lgtm

client/pkg/connectionctx/manager.go Outdated Show resolved Hide resolved
client/pkg/connectionctx/manager.go Outdated Show resolved Hide resolved
client/pkg/connectionctx/manager.go Show resolved Hide resolved
client/clients/tso/dispatcher.go Show resolved Hide resolved
@JmPotato JmPotato force-pushed the reduce_member_update branch from 192f36e to 62e20a2 Compare December 26, 2024 08:00
@JmPotato JmPotato requested a review from okJiang December 26, 2024 08:01
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 26, 2024
@ti-chi-bot ti-chi-bot bot added the lgtm label Dec 26, 2024
Copy link
Contributor

ti-chi-bot bot commented Dec 26, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: okJiang, 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 Dec 26, 2024
Copy link
Contributor

ti-chi-bot bot commented Dec 26, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-25 08:32:48.534419925 +0000 UTC m=+1636958.623222453: ☑️ agreed by rleungx.
  • 2024-12-26 08:05:29.068391698 +0000 UTC m=+1721719.157194240: ☑️ agreed by okJiang.

Signed-off-by: JmPotato <[email protected]>
@JmPotato JmPotato force-pushed the reduce_member_update branch from 62e20a2 to f84cf99 Compare December 26, 2024 08:21
@ti-chi-bot ti-chi-bot bot merged commit 8cd7233 into tikv:master Dec 27, 2024
25 checks passed
@JmPotato JmPotato deleted the reduce_member_update branch December 27, 2024 08:07
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