Skip to content

Optimize pending acks cleanup by mark delete position in PersistentDispatcherMultipleConsumers #24499

@lhotari

Description

@lhotari

Another difference is

// remove possible expired messages from redelivery tracker and pending acks
Position markDeletePosition = cursor.getMarkDeletedPosition();
if (lastMarkDeletePositionBeforeReadMoreEntries != markDeletePosition) {
redeliveryMessages.removeAllUpTo(markDeletePosition.getLedgerId(), markDeletePosition.getEntryId());
for (Consumer consumer : consumerList) {
consumer.getPendingAcks()
.removeAllUpTo(markDeletePosition.getLedgerId(), markDeletePosition.getEntryId());
}
lastMarkDeletePositionBeforeReadMoreEntries = markDeletePosition;
}
which is important for PIP-379. It might need to be optimized so that it's run asynchronously and batched in a way that multiple mark delete updates would only run for the latest update at most once per second.

Originally posted by @lhotari in #24490

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions