-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Broker] Check allowAutoSubscriptionCreation when creating init sub
#14458
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
Conversation
Motivation In apache#13355, we added support for creating initial subscription when creating the producer. But the broker didn't check if the subscription can be created automatically. The initial subscription will be created even if the `allowAutoSubscriptionCreation` is disabled. Modification * Check `allowAutoSubscriptionCreation` when creating the initial subscription. Signed-off-by: Zike Yang <[email protected]>
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Outdated
Show resolved
Hide resolved
|
@codelipenghui - this seems like a missing component for PIP 124, which made it into |
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Show resolved
Hide resolved
|
I have added release/2.10.1 just to make sure I will not miss to cherry-pick this one, after cherry-picking I will change to 2.10.0, |
Signed-off-by: Zike Yang <[email protected]>
Signed-off-by: Zike Yang <[email protected]>
…t sub Motivation This PR is the doc for apache#14458 Modification * Add doc for check `allowAutoSubscriptionCreation` when creating init sub Signed-off-by: Zike Yang <[email protected]>
Signed-off-by: Zike Yang <[email protected]>
Signed-off-by: Zike Yang <[email protected]>
michaeljmarshall
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
| log.warn("[{}] {} initialSubscriptionName: {}, topic: {}", | ||
| remoteAddress, msg, initialSubscriptionName, topicName); | ||
| commandSender.sendErrorResponse(requestId, | ||
| ServerError.NotAllowedError, msg); |
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.
Note that the consequence of sending this NotAllowedError is that the consumer will indefinitely send messages back to the broker to be redelivered. I think this is a sane default since it means messages won't be lost. I just want to make sure we agree on this design.
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.
+1
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.
That's right. +1
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerBuilderImpl.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Zike Yang <[email protected]>
eolivelli
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
mattisonchao
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
…#14458) Master Issue: #13408 ### Motivation In #13355, we added support for creating initial subscription when creating the producer. But the broker didn't check if the subscription can be created automatically. The initial subscription will be created even if the `allowAutoSubscriptionCreation` is disabled. (cherry picked from commit db25438)
…apache#14458) Master Issue: apache#13408 ### Motivation In apache#13355, we added support for creating initial subscription when creating the producer. But the broker didn't check if the subscription can be created automatically. The initial subscription will be created even if the `allowAutoSubscriptionCreation` is disabled.
Master Issue: #13408
Motivation
In #13355, we added support for creating initial subscription when creating the producer. But the broker didn't check if the subscription can be created automatically. The initial subscription will be created even if the
allowAutoSubscriptionCreationis disabled.Modifications
allowAutoSubscriptionCreationwhen creating the initial subscription.Verifying this change
This change is already covered by existing tests, such as testInitialSubscriptionCreationWithAutoCreationDisable.
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation
doc