From 77ad2b0bc0aff353b6d535aee1351ae49c7bb501 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Tue, 18 Oct 2022 11:51:47 -0400 Subject: [PATCH] ARTEMIS-4056 Expanding nextPage check into isDeleted --- .../artemis/core/paging/cursor/impl/PageSubscriptionImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java index 3be9037fb9..cdbd1dba72 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java @@ -1508,7 +1508,8 @@ public final class PageSubscriptionImpl implements PageSubscription { while (page <= pageStore.getCurrentWritingPage()) { PageCursorInfo info = locatePageInfo(page); - if (info == null || info.getCompleteInfo() == null) { + // if pendingDelete or complete, we just move to next page + if (info == null || info.getCompleteInfo() == null && !info.isPendingDelete()) { return page; } if (logger.isDebugEnabled()) {