diff --git a/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java b/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java index c476e42dc7..95ce7ecb37 100644 --- a/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java +++ b/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java @@ -425,6 +425,7 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener, } Integer lastDataFile = asyncDataManager.getCurrentDataFileId(); inProgress.add(lastDataFile); + lastDataFile = asyncDataManager.getMark().getDataFileId(); inProgress.addAll(referenceStoreAdapter.getReferenceFileIdsInUse()); Location lastActiveTx = transactionStore.checkpoint(); if (lastActiveTx != null) { diff --git a/activemq-core/src/test/java/org/apache/activemq/bugs/MissingDataFileTest.java b/activemq-core/src/test/java/org/apache/activemq/bugs/MissingDataFileTest.java index 67008a830f..f410fd7721 100644 --- a/activemq-core/src/test/java/org/apache/activemq/bugs/MissingDataFileTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/bugs/MissingDataFileTest.java @@ -94,12 +94,12 @@ public class MissingDataFileTest extends TestCase { SystemUsage systemUsage; systemUsage = new SystemUsage(); - systemUsage.getMemoryUsage().setLimit(1024 * 10); // Just a few messags + systemUsage.getMemoryUsage().setLimit(1024 * 1024); // Just a few messags broker.setSystemUsage(systemUsage); AMQPersistenceAdapterFactory factory = (AMQPersistenceAdapterFactory) broker.getPersistenceFactory(); factory.setMaxFileLength(2*1024); // ~4 messages - factory.setCleanupInterval(5000); // every few second + factory.setCleanupInterval(1000); // every few second broker.start(); LOG.info("Starting broker..");