Skip to content

brpc dns cache#63546

Open
zhangstar333 wants to merge 1 commit into
apache:masterfrom
zhangstar333:brpc_dns_cache
Open

brpc dns cache#63546
zhangstar333 wants to merge 1 commit into
apache:masterfrom
zhangstar333:brpc_dns_cache

Conversation

@zhangstar333
Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@zhangstar333
Copy link
Copy Markdown
Contributor Author

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

I found one blocking issue: the BE test mock override was not updated after changing ExchangeSinkBuffer::_failed to take Status, so BE test builds that include exchange_sink_test.h will fail to compile.

Critical checkpoint conclusions:

  • Goal and correctness: The PR aims to refresh DNS/cache state on BRPC network faults and validate rebuilt cached clients with handshake. The core runtime path is directionally consistent, but the change is not build-correct for BE tests.
  • Scope: The runtime changes are mostly focused on BRPC client/DNS cache behavior, with small call-site updates for original hostnames.
  • Concurrency: DNS dirty/cache access is protected by the existing shared_mutex in the changed paths; I did not find a new lock-order issue in the reviewed diff.
  • Lifecycle/static initialization: No new cross-TU static initializer dependency was found.
  • Configuration: Two mutable configs are added; dynamic reads are used at client lookup time. The config default enables the new handshake path, so this needs successful build/test coverage before merge.
  • Compatibility: No persisted format or FE/BE thrift schema change was introduced. The handshake RPC already exists on the affected stubs.
  • Parallel paths: Direct no-cache BRPC call sites touched by the PR pass the original hostname where available; cached get_client paths are centralized.
  • Tests: No test evidence is provided in the PR description, and the existing BE exchange test mock is currently broken by the signature change.
  • Observability: The changed paths log DNS invalidation, network faults, and handshake failures; no additional metrics appear strictly required for this patch.
  • Transactions/data writes: No direct transaction or storage visibility changes were introduced.
  • Performance: The new default synchronous handshake on cache misses can add latency, but I did not identify a separate blocking correctness issue beyond the compile break.

User focus points: no additional user-provided review focus was present.

#else
virtual void _ended(RpcInstance& ins);
virtual void _failed(InstanceLoId id, const std::string& err);
virtual void _failed(InstanceLoId id, Status err);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This signature change breaks the BE test mock override. be/test/exec/exchange/exchange_sink_test.h still declares void _failed(InstanceLoId id, const std::string& err) override, so when tests are built with BE_TEST the override no longer matches ExchangeSinkBuffer::_failed(InstanceLoId, Status) and compilation will fail. Please update the mock (and any other BE_TEST overrides) to take Status, or avoid changing the virtual test-only signature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants