poorbarcode commented on code in PR #16707:
URL: https://github.com/apache/pulsar/pull/16707#discussion_r926560190
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/MLPendingAckStore.java:
##########
@@ -332,14 +408,41 @@ public void run() {
while (lastConfirmedEntry.compareTo(currentLoadPosition) > 0
&& fillEntryQueueCallback.fillQueue()) {
Entry entry = entryQueue.poll();
if (entry != null) {
- ByteBuf buffer = entry.getDataBuffer();
currentLoadPosition =
PositionImpl.get(entry.getLedgerId(), entry.getEntryId());
- PendingAckMetadataEntry pendingAckMetadataEntry = new
PendingAckMetadataEntry();
- pendingAckMetadataEntry.parseFrom(buffer,
buffer.readableBytes());
- currentIndexLag.incrementAndGet();
- handleMetadataEntry(new
PositionImpl(entry.getLedgerId(), entry.getEntryId()),
- pendingAckMetadataEntry);
-
pendingAckReplyCallBack.handleMetadataEntry(pendingAckMetadataEntry);
+ List<PendingAckMetadataEntry> logs =
deserializeEntry(entry);
+ if (logs.isEmpty()){
+ continue;
+ } else if (logs.size() == 1){
+ currentIndexLag.incrementAndGet();
+ PendingAckMetadataEntry log = logs.get(0);
+ handleMetadataEntry(new
PositionImpl(entry.getLedgerId(), entry.getEntryId()), log);
+ pendingAckReplyCallBack.handleMetadataEntry(log);
+ } else {
+ /**
+ * 1. Query batch index of current entry from
cursor.
+ * 2. Filter the data which has already ack.
+ * 3. Build batched position and handle valid data.
+ */
+ long[] ackSetAlreadyAck =
cursor.getDeletedBatchIndexesAsLongArray(
+ PositionImpl.get(entry.getLedgerId(),
entry.getEntryId()));
+ BitSetRecyclable bitSetAlreadyAck = null;
+ if (ackSetAlreadyAck != null){
+ bitSetAlreadyAck =
BitSetRecyclable.valueOf(ackSetAlreadyAck);
+ }
Review Comment:
Already fixed.
--
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]