This is an automated email from the ASF dual-hosted git repository.
mattisonchao pushed a commit to branch branch-2.9
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-2.9 by this push:
new 77c333ca47e [improve][client] improve logic when ACK grouping tracker
checks duplicated message id (#15465)
77c333ca47e is described below
commit 77c333ca47ec9d1a01c5f4448cad309a60e3f208
Author: Qiang Zhao <[email protected]>
AuthorDate: Sat May 7 15:35:04 2022 +0800
[improve][client] improve logic when ACK grouping tracker checks duplicated
message id (#15465)
(cherry picked from commit f6faeecc819de880eb4a93e4bb359bebbc0bc855)
---
.../pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java
index e737a2a6f16..dc311521083 100644
---
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java
+++
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java
@@ -117,10 +117,7 @@ public class PersistentAcknowledgmentsGroupingTracker
implements Acknowledgments
@Override
public boolean isDuplicate(@NonNull MessageId messageId) {
final MessageId messageIdOfLastAck = lastCumulativeAck.messageId;
- if (messageIdOfLastAck == null) {
- return false;
- }
- if (messageId.compareTo(messageIdOfLastAck) <= 0) {
+ if (messageIdOfLastAck != null &&
messageId.compareTo(messageIdOfLastAck) <= 0) {
// Already included in a cumulative ack
return true;
} else {