Skip to content

client: avoid RM fallback warning spam#10522

Merged
ti-chi-bot[bot] merged 1 commit intotikv:masterfrom
okJiang:codex/fix-rm-discovery-log-spam
Apr 1, 2026
Merged

client: avoid RM fallback warning spam#10522
ti-chi-bot[bot] merged 1 commit intotikv:masterfrom
okJiang:codex/fix-rm-discovery-log-spam

Conversation

@okJiang
Copy link
Copy Markdown
Member

@okJiang okJiang commented Mar 31, 2026

What problem does this PR solve?

Issue Number: Close #10521

When PD runs without a standalone resource manager, client-side discovery keeps warning even though falling back to the PD-provided resource manager is expected. This makes normal deployments noisy and hides real problems.

What is changed and how does it work?

Treat a missing standalone resource manager endpoint as a normal fallback state.
Stop warning when the resource manager connection is empty in the expected PD fallback path.

Check List

Tests

  • Unit test

Release note

Fixed warning spam when PD falls back to its built-in resource manager because no standalone resource manager is deployed.

Summary by CodeRabbit

  • Refactor
    • Simplified service discovery error handling for missing serving endpoints
    • Modified endpoint absence handling to return empty results instead of errors
    • Streamlined gRPC connection state management logic

Treat a missing standalone resource manager endpoint as a normal PD fallback state.

Stop warning when the RM connection is empty in that expected path.

Signed-off-by: okjiang <819421878@qq.com>
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has signed the dco. do-not-merge/needs-triage-completed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 31, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dcea9563-bd48-4c96-bbf6-6e183f1a8668

📥 Commits

Reviewing files that changed from the base of the PR and between 0a0dcfd and 7221ca8.

📒 Files selected for processing (1)
  • client/servicediscovery/resource_manager_service_discovery.go

📝 Walkthrough

Walkthrough

Modified service discovery error handling to treat missing standalone resource manager endpoints as normal fallback states rather than errors. Removed connection reset logic and error-based warning logs when discovery returns empty results or connection is unavailable.

Changes

Cohort / File(s) Summary
Service Discovery Error Handling
client/servicediscovery/resource_manager_service_discovery.go
Removed errors.ErrorEqual-based error detection and connection reset logic; changed GetConn() to return connection without conditional warning; modified discoverServiceURL() to return empty success states ("", revision, nil) instead of error codes when no endpoint data exists.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Poem

🐰 No more warnings in the logs today,
Empty endpoints are perfectly okay,
Fallback flows now calm and still,
Silence where there once was shrill,
Resources discovered with gentler ways.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: eliminating warning spam from the RM fallback code path when a standalone resource manager is not deployed.
Description check ✅ Passed The description includes the required sections: problem statement, what changed, test type, and release notes aligned with the PR template.
Linked Issues check ✅ Passed The code changes directly address all requirements from issue #10521: removing error handling that triggered warnings, simplifying GetConn() to not warn on nil connection, and treating missing endpoint as normal fallback.
Out of Scope Changes check ✅ Passed All changes are scoped to resource_manager_service_discovery.go and directly address the warning spam issue; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@okJiang
Copy link
Copy Markdown
Member Author

okJiang commented Apr 1, 2026

/retest

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.91%. Comparing base (3eb99ae) to head (7221ca8).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10522      +/-   ##
==========================================
+ Coverage   78.88%   78.91%   +0.03%     
==========================================
  Files         530      531       +1     
  Lines       71548    71626      +78     
==========================================
+ Hits        56439    56525      +86     
+ Misses      11092    11075      -17     
- Partials     4017     4026       +9     
Flag Coverage Δ
unittests 78.91% <33.33%> (+0.03%) ⬆️

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.

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Apr 1, 2026
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot bot commented Apr 1, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bufferflies, lhy1024

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:
  • OWNERS [bufferflies,lhy1024]

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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 1, 2026
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot bot commented Apr 1, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-04-01 06:30:26.413606166 +0000 UTC m=+333031.618966223: ☑️ agreed by bufferflies.
  • 2026-04-01 06:35:17.887191362 +0000 UTC m=+333323.092551419: ☑️ agreed by lhy1024.

@okJiang
Copy link
Copy Markdown
Member Author

okJiang commented Apr 1, 2026

/retest

@ti-chi-bot ti-chi-bot bot merged commit 048f0d8 into tikv:master Apr 1, 2026
39 of 44 checks passed
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot bot commented Apr 1, 2026

@okJiang: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-unit-test-next-gen-2 7221ca8 link unknown /test pull-unit-test-next-gen-2
pull-unit-test-next-gen-1 7221ca8 link unknown /test pull-unit-test-next-gen-1

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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 Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

client: avoid warning spam when standalone resource manager is not deployed

3 participants