-
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
[fix][broker] Fix creating producer failure when set backlog quota. #15663
[fix][broker] Fix creating producer failure when set backlog quota. #15663
Conversation
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
Outdated
Show resolved
Hide resolved
5c6c4d9
to
73ccd91
Compare
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 minor comment.
org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedLedgerInfo.LedgerInfo | ||
ledgerInfo = ledger.getLedgerInfo(ledgerId).get(); |
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.
Here will be a risk to call .get()
directly since the implementation of getLedgerInfo()
might changed although this does not appear to be a problem at present.
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.
Yes, I think we can use another PR to make it asynchronous.
pulsar-broker/src/test/java/org/apache/pulsar/broker/systopic/PartitionedSystemTopicTest.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/systopic/PartitionedSystemTopicTest.java
Outdated
Show resolved
Hide resolved
73ccd91
to
9ce00b3
Compare
9ce00b3
to
d93ae3c
Compare
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
Show resolved
Hide resolved
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.
pulsar-broker/src/test/java/org/apache/pulsar/broker/systopic/PartitionedSystemTopicTest.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/systopic/PartitionedSystemTopicTest.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/systopic/PartitionedSystemTopicTest.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/systopic/PartitionedSystemTopicTest.java
Show resolved
Hide resolved
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.
…15663) When trying to reproduce the problem of #15609 using the master's code, it was found that the master also had this bug. The root cause is: When there is only one ledger in the ManagedLedger, after the current ledger is closed, it has the timestamp and exceeds the time set by the backlog-qutoa, resulting in the failure to create the producer. The added test could reproduce this. So when there is only one ledger, we should not exclude it. If revert this patch, the added test will fail. (cherry picked from commit 3a80458)
…15663) When trying to reproduce the problem of #15609 using the master's code, it was found that the master also had this bug. The root cause is: When there is only one ledger in the ManagedLedger, after the current ledger is closed, it has the timestamp and exceeds the time set by the backlog-qutoa, resulting in the failure to create the producer. The added test could reproduce this. So when there is only one ledger, we should not exclude it. If revert this patch, the added test will fail. (cherry picked from commit 3a80458)
…15663) When trying to reproduce the problem of #15609 using the master's code, it was found that the master also had this bug. The root cause is: When there is only one ledger in the ManagedLedger, after the current ledger is closed, it has the timestamp and exceeds the time set by the backlog-qutoa, resulting in the failure to create the producer. The added test could reproduce this. So when there is only one ledger, we should not exclude it. If revert this patch, the added test will fail. (cherry picked from commit 3a80458)
…quota. (apache#15663)" This reverts commit 90c4653.
…pache#15663) When trying to reproduce the problem of apache#15609 using the master's code, it was found that the master also had this bug. The root cause is: When there is only one ledger in the ManagedLedger, after the current ledger is closed, it has the timestamp and exceeds the time set by the backlog-qutoa, resulting in the failure to create the producer. The added test could reproduce this. So when there is only one ledger, we should not exclude it. If revert this patch, the added test will fail. (cherry picked from commit 3a80458) (cherry picked from commit cc8895e)
…pache#15663) When trying to reproduce the problem of apache#15609 using the master's code, it was found that the master also had this bug. The root cause is: When there is only one ledger in the ManagedLedger, after the current ledger is closed, it has the timestamp and exceeds the time set by the backlog-qutoa, resulting in the failure to create the producer. The added test could reproduce this. So when there is only one ledger, we should not exclude it. If revert this patch, the added test will fail. (cherry picked from commit 3a80458) (cherry picked from commit dc7d512)
Motivation
When trying to reproduce the problem of #15609 using the master's code, it was found that the master also had this bug. The root cause is:
When there is only one ledger in the ManagedLedger, after the current ledger is closed, it has the timestamp and exceeds the time set by the backlog-qutoa, resulting in the failure to create the producer.
The added test could reproduce this.
So when there is only one ledger, we should not exclude it.
Verifying this change
If revert this patch, the added test will fail.
Documentation
no-need-doc
(Please explain why)