From 8d4001ad0be6bc8c26af4ea5ad5557b2f36212a4 Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Wed, 18 Jun 2008 19:34:27 +0000 Subject: [PATCH] Further patch for https://issues.apache.org/activemq/browse/AMQ-1795 git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@669265 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/store/amq/AMQPersistenceAdapter.java | 1 + .../java/org/apache/activemq/bugs/MissingDataFileTest.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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..");