Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1245,18 +1245,6 @@ PositionImpl setAcknowledgedPosition(PositionImpl newMarkDeletePosition) {
throw new IllegalArgumentException("Mark deleting an already mark-deleted position");
}

if (readPosition.compareTo(newMarkDeletePosition) <= 0) {
// If the position that is mark-deleted is past the read position, it
// means that the client has skipped some entries. We need to move
// read position forward
PositionImpl oldReadPosition = readPosition;
readPosition = ledger.getNextValidPosition(newMarkDeletePosition);

if (log.isDebugEnabled()) {
log.debug("[{}] Moved read position from: {} to: {}", ledger.getName(), oldReadPosition, readPosition);
}
}

PositionImpl oldMarkDeletePosition = markDeletePosition;

if (!newMarkDeletePosition.equals(oldMarkDeletePosition)) {
Expand Down Expand Up @@ -1285,6 +1273,19 @@ PositionImpl setAcknowledgedPosition(PositionImpl newMarkDeletePosition) {
// markDelete-position and clear out deletedMsgSet
markDeletePosition = PositionImpl.get(newMarkDeletePosition);
individualDeletedMessages.remove(Range.atMost(markDeletePosition));

if (readPosition.compareTo(newMarkDeletePosition) <= 0) {
// If the position that is mark-deleted is past the read position, it
// means that the client has skipped some entries. We need to move
// read position forward
PositionImpl oldReadPosition = readPosition;
readPosition = ledger.getNextValidPosition(newMarkDeletePosition);

if (log.isDebugEnabled()) {
log.debug("[{}] Moved read position from: {} to: {}, and new mark-delete position {}", ledger.getName(),
oldReadPosition, readPosition, markDeletePosition);
}
}

return newMarkDeletePosition;
}
Expand Down