-
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
[PIP-130] Apply redelivery backoff policy for ack timeout #13707
[PIP-130] Apply redelivery backoff policy for ack timeout #13707
Conversation
/pulsarbot run-failure-checks |
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
Show resolved
Hide resolved
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
…-master handle conflict
…_ack_timeout handle conflict
/pulsarbot run-failure-checks |
pulsar-client/src/main/java/org/apache/pulsar/client/impl/UnAckedMessageRedeliveryTracker.java
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/UnAckedMessageRedeliveryTracker.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/UnackMessageIdWrapper.java
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ExponentialRedeliveryBackoff.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiplierRedeliveryBackoff.java
Outdated
Show resolved
Hide resolved
...ar-broker/src/test/java/org/apache/pulsar/client/impl/UnAcknowledgedMessagesTimeoutTest.java
Outdated
Show resolved
Hide resolved
...ar-broker/src/test/java/org/apache/pulsar/client/impl/UnAcknowledgedMessagesTimeoutTest.java
Show resolved
Hide resolved
...ar-broker/src/test/java/org/apache/pulsar/client/impl/UnAcknowledgedMessagesTimeoutTest.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiplierRedeliveryBackoff.java
Outdated
Show resolved
Hide resolved
this.maxDelayMs = maxDelayMs; | ||
this.multiplier = multiplier; | ||
maxMultiplierPow = multiplier == 1 ? -1 : | ||
(int) (Math.log((double) maxDelayMs / minDelayMs) / Math.log(multiplier)) + 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.
Would this "+ 1" here causing the final result overflow?
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.
No, this parameter is to reduce invalid POW calculations.
super(client, consumerBase, conf); | ||
this.ackTimeoutRedeliveryBackoff = conf.getAckTimeoutRedeliveryBackoff(); | ||
this.ackTimeoutMessages = new HashMap<MessageId, Long>(); | ||
this.redeliveryMessageIdPartitionMap = new ConcurrentHashMap<>(); |
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.
Does this redeliveryMessageIdPartitionMap
need to be ConcurrentHashMap ?
It seems to be wrapped with writeLock
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.
can remove concurrent var.
pulsar-client/src/main/java/org/apache/pulsar/client/impl/UnAckedMessageRedeliveryTracker.java
Show resolved
Hide resolved
/pulsarbot run-failure-checks |
2 similar comments
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
### Motivation This pull request is the specific implementation plan of PIP-130 ### Modifications *Apply the message redelivery policy for the ack timeout.* *Alert NegativeAckBackoff interface to RedeliveryBackoff.* *Expose AckTimeoutRedeliveryBackoff in ConsumerBulider.*
Master Issue: #13528
Motivation
This pull request is the specific implementation plan of PIP-130
Modifications
Apply the message redelivery policy for the ack timeout.
Alert NegativeAckBackoff interface to RedeliveryBackoff.
Expose AckTimeoutRedeliveryBackoff in ConsumerBulider.
Add unit test case.
Currently only the Java client is modified.
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation
Need to update docs?
doc