ARTEMIS-3761 Improve page cleanup to remove messages in the middle of the stream...
authorClebert Suconic <clebertsuconic@apache.org>
Fri, 1 Apr 2022 02:01:30 +0000 (22:01 -0400)
committerclebertsuconic <clebert.suconic@gmail.com>
Thu, 7 Apr 2022 14:33:08 +0000 (10:33 -0400)
commitcfdb710a085b7d5994bfeb1d65357388b0d643b5
tree233e7197a31b4a2ad4cb7986ff4408a6acc05e8e
parent1da68b3024e7f1e182aa8f279a3ac85f9946cda1
ARTEMIS-3761 Improve page cleanup to remove messages in the middle of the stream as well

Paging only removes files at the beginning of the stream...
Say you have paged files 1 through 1000...
if all the messages are ack, but one message on file 1 is missing an ack, all the 999 subsequent files would not be removed until all the messages on file 1 is ack.
This was working as engineered, but sometimes devs don't have complete control on their app.
With this improvement we will now remove messages in the middle of the stream as well.

There is also some improvement to how browsing and page work with this
21 files changed:
artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/PrintData.java
artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataExporter.java
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagingStore.java
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/ConsumedPage.java [new file with mode: 0644]
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PageSubscription.java
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageCursorProviderImpl.java
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/Page.java
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationEndpoint.java
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java
artemis-server/src/test/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageReaderTest.java
artemis-server/src/test/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreTestAccessor.java [new file with mode: 0644]
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpireTestOnRestartTest.java
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/GlobalPagingTest.java
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java
tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/storage/PersistMultiThreadTest.java
tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java
tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java
tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java
tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/FakeQueue.java