-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] fix namespace deletion TLS URL selection for geo-replication #24591
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
[fix][broker] fix namespace deletion TLS URL selection for geo-replication #24591
Conversation
…ation When deleting a namespace that needs to be redirected to a remote cluster, the code was incorrectly using the local broker's TLS configuration to determine whether to use HTTP or HTTPS URLs. This caused NullPointerException when the remote cluster had different TLS settings. Changed the logic to use the remote cluster's brokerClientTlsEnabled setting instead of the local broker's TLS configuration, ensuring proper URL selection based on the target cluster's capabilities. Added comprehensive test coverage for three scenarios: - Remote cluster with TLS disabled (uses HTTP) - Remote cluster with TLS enabled (uses HTTPS) - Remote cluster with TLS enabled but no TLS URL (proper error handling) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
lhotari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Not directly related to this PR, but noticed that the test was using "global" clusters, it seems that it's a TopicName/NamespaceName v1 syntax concept which was deprecated by "PIP-10: Remove cluster for namespace and topic names". All topics in v2 format There's a discussion thread on dev mailing list related to Topic / Namespace v1 formats used in tests: @codelipenghui @poorbarcode Are we going to deprecate TopicName / NamespaceName v1 (as was done in PIP-10) or is there a need for v1 format in the future? |
|
@lhotari Let me change the test first. Since there are objections in the community to remove V1 format support, I think it's fine. But we can continue to mark V1 as deprecated to avoid new users to continue use V1 format topic. |
…ation (apache#24591) (cherry picked from commit b06d2ec)
…ation (apache#24591) (cherry picked from commit b06d2ec)
Summary
Problem
When deleting a namespace that needs to be redirected to a remote cluster in geo-replication scenarios, the code was incorrectly using the local broker's TLS configuration (
config().isTlsEnabled() || \!isRequestHttps()) to determine whether to use HTTP or HTTPS URLs for the redirect. This caused issues when:serviceUrlTlswas null but TLS logic tried to access itNullPointerException: Cannot invoke "String.length()" because "<parameter2>" is nullat NamespacesBase.java:440Solution
Changed the logic in
NamespacesBase.java:439from:to:
This ensures that the TLS URL selection is based on the remote cluster's TLS configuration, not the local broker's configuration.
Test Coverage
Added
testDeleteNamespaceUsesRemoteClusterTlsConfig()which validates three scenarios:Test Plan
Documentation
docdoc-requireddoc-not-neededdoc-complete