Skip to content

client: resource manager service discovery#9785

Merged
ti-chi-bot[bot] merged 40 commits intotikv:masterfrom
okJiang:rm-client-discovery
Jan 6, 2026
Merged

client: resource manager service discovery#9785
ti-chi-bot[bot] merged 40 commits intotikv:masterfrom
okJiang:rm-client-discovery

Conversation

@okJiang
Copy link
Copy Markdown
Member

@okJiang okJiang commented Sep 28, 2025

What problem does this PR solve?

  • cherry-pick eadad73
  • cherry-pick 9411339
  • Enable service discovery in resource_manager_test.go
  • remove the related Option from resource manager client

Issue Number: Ref #9737

What is changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

Release note

None.

Signed-off-by: disksing <i@disksing.com>
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot bot commented Sep 28, 2025

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 release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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 Sep 28, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 28, 2025

Codecov Report

❌ Patch coverage is 84.91379% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.53%. Comparing base (8139aa6) to head (1ed5031).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9785      +/-   ##
==========================================
+ Coverage   78.40%   78.53%   +0.12%     
==========================================
  Files         518      520       +2     
  Lines       69438    69658     +220     
==========================================
+ Hits        54441    54703     +262     
+ Misses      11045    11004      -41     
+ Partials     3952     3951       -1     
Flag Coverage Δ
unittests 78.53% <84.91%> (+0.12%) ⬆️

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@okJiang okJiang marked this pull request as ready for review December 19, 2025 04:17
@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 Dec 19, 2025
Signed-off-by: okjiang <819421878@qq.com>
@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 19, 2025
okJiang and others added 5 commits December 24, 2025 14:56
Signed-off-by: okjiang <819421878@qq.com>
Signed-off-by: okjiang <819421878@qq.com>
Signed-off-by: okjiang <819421878@qq.com>
Signed-off-by: okjiang <819421878@qq.com>
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 24, 2025
@okJiang
Copy link
Copy Markdown
Member Author

okJiang commented Dec 24, 2025

/retest

Signed-off-by: okjiang <819421878@qq.com>
@ti-chi-bot ti-chi-bot bot removed the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Dec 25, 2025
@okJiang
Copy link
Copy Markdown
Member Author

okJiang commented Jan 5, 2026

/retest

Signed-off-by: okjiang <819421878@qq.com>
Signed-off-by: okjiang <819421878@qq.com>
Signed-off-by: okjiang <819421878@qq.com>
Signed-off-by: okjiang <819421878@qq.com>
Signed-off-by: okjiang <819421878@qq.com>
@okJiang
Copy link
Copy Markdown
Member Author

okJiang commented Jan 5, 2026

/retest

func (r *ResourceManagerDiscovery) resetConn(url string) {
r.mu.Lock()
defer r.mu.Unlock()
if url == "" {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How about len(url) == 0?

r.resetConn(url)
revision = newRevision
}
case <-r.updateServiceURLCh:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is the difference between <-ticker.C and <-r.updateServiceURLCh?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If the request failed, client will trigger updateServiceURLCh to update url actively.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The handle code does not exist any difference.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Then we can reduce the duplicated code?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done it. ptal~

Signed-off-by: okjiang <819421878@qq.com>
@okJiang
Copy link
Copy Markdown
Member Author

okJiang commented Jan 5, 2026

/retest

Signed-off-by: okjiang <819421878@qq.com>
@okJiang
Copy link
Copy Markdown
Member Author

okJiang commented Jan 5, 2026

/retest

}

// ScheduleUpateServiceURL schedules an update of the service URL.
func (r *ResourceManagerDiscovery) ScheduleUpateServiceURL() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
func (r *ResourceManagerDiscovery) ScheduleUpateServiceURL() {
func (r *ResourceManagerDiscovery) ScheduleUpdateServiceURL() {

Signed-off-by: okjiang <819421878@qq.com>
Copy link
Copy Markdown
Member

@rleungx rleungx left a comment

Choose a reason for hiding this comment

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

The rest LGTM

}
}

func shouldScheduleResourceManagerServiceURLUpdate(err error) bool {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The function name is too long

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

updated to shouldUpdateRMURL

Signed-off-by: okjiang <819421878@qq.com>
@okJiang
Copy link
Copy Markdown
Member Author

okJiang commented Jan 6, 2026

/retest

1 similar comment
@okJiang
Copy link
Copy Markdown
Member Author

okJiang commented Jan 6, 2026

/retest

Signed-off-by: okjiang <819421878@qq.com>
@ti-chi-bot ti-chi-bot bot added the lgtm label Jan 6, 2026
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot bot commented Jan 6, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: disksing, niubell, rleungx

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

The pull request process is described here

Details 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 6, 2026
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot bot commented Jan 6, 2026

[LGTM Timeline notifier]

Timeline:

  • 2025-12-26 08:25:36.270819475 +0000 UTC m=+2411881.084597037: ☑️ agreed by disksing.
  • 2026-01-06 05:52:37.855253976 +0000 UTC m=+681513.673562418: ☑️ agreed by rleungx.

@ti-chi-bot ti-chi-bot bot merged commit 757acdf into tikv:master Jan 6, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved 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.

5 participants