congbobo184 commented on code in PR #18154:
URL: https://github.com/apache/pulsar/pull/18154#discussion_r1001827854
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java:
##########
@@ -658,6 +658,16 @@ protected LastCumulativeAck initialValue() {
private boolean flushRequired = false;
public synchronized void update(final MessageIdImpl messageId, final
BitSetRecyclable bitSetRecyclable) {
+ if (messageId.equals(this.messageId)) {
+ if (this.bitSetRecyclable != null && bitSetRecyclable != null
+ && bitSetRecyclable.nextSetBit(0) >
this.bitSetRecyclable.nextSetBit(0)) {
+ this.bitSetRecyclable.recycle();
+ set(messageId, bitSetRecyclable);
+ flushRequired = true;
+ }
+ return;
+ }
+
if (messageId.compareTo(this.messageId) > 0) {
Review Comment:
seem compareTo has already compare the batchIndex.
https://github.com/apache/pulsar/blob/fa328a42d5770a27237d926eac97385284876174/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageIdImpl.java#L248-L253
so we don't need to do single check, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]