-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[broker] fix GetTopicsOfNamespace
with binary lookup service not check auth
#11172
[broker] fix GetTopicsOfNamespace
with binary lookup service not check auth
#11172
Conversation
/pulsarbot run-failure-checks |
@freeznet does this affect docs? |
@Anonymitaet thanks for asking, and I dont think this fix relates to any doc yet. |
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.
very good.
can you add a test case ?
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Show resolved
Hide resolved
31a8e16
to
b1f268d
Compare
b1f268d
to
5edbfef
Compare
/pulsarbot run-failure-checks |
@eolivelli changes have been made according to your comment, PTAL, thanks. |
@eolivelli please review this PR again. |
@eolivelli Can you review this again? |
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. Left a couple of low priority comments about reducing code duplication.
@@ -1722,30 +1723,97 @@ public void readEntryFailed(ManagedLedgerException exception, Object ctx) { | |||
}); | |||
} | |||
|
|||
private CompletableFuture<Boolean> isNamespaceOperationAllowed(NamespaceName namespaceName, |
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.
It seems like this method and the isTopicOperationAllowed
method share a lot of core logic with just a couple places that would branch for looking up allowNamespaceOperationAsync
vs allowNamespaceOperationAsync
. It'd be good to consolidate this logic, if possible.
|
||
return null; | ||
}); | ||
final Semaphore lookupSemaphore = service.getLookupRequestSemaphore(); |
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.
I'm seeing some code duplication in this file where we call service.getLookupRequestSemaphore()
. It could be good to come back later and consolidate the code.
@eolivelli Would you please help review again? thanks. |
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.
Lgrm
@hangc0276 - I believe this commit should be cherry picked to |
@michaeljmarshall Thanks for your remind, i have add release-2.7.4 label, this PR will be cherry-picked to branch-2.7. |
fix TestNamespaceTopicsNamespaceDoesNotExit error after pulsar release 2.8.1 ref: apache/pulsar#11172
Motivation
apache/pulsar-client-go#554 reported an issue and we found out an inconsistency between http lookup service and binary lookup service. It appears that http lookup service requires auth check for
GetTopicsOfNamespace
but not with binary lookup service.This PR adds
GetTopicsOfNamespace
with binary lookup service.GetTopicsOfNamespace
with binary lookup service.Verifying this change