Author: clebert.suconic(a)jboss.com
Date: 2010-05-28 20:11:49 -0400 (Fri, 28 May 2010)
New Revision: 9285
Modified:
trunk/src/main/org/hornetq/core/journal/impl/JournalImpl.java
Log:
https://jira.jboss.org/browse/HORNETQ-399 - cleanup files shouldn't be reused after
freed
Modified: trunk/src/main/org/hornetq/core/journal/impl/JournalImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/JournalImpl.java 2010-05-28 16:20:26 UTC
(rev 9284)
+++ trunk/src/main/org/hornetq/core/journal/impl/JournalImpl.java 2010-05-29 00:11:49 UTC
(rev 9285)
@@ -1453,7 +1453,6 @@
try
{
JournalImpl.trace("Starting compacting operation on journal");
- JournalImpl.log.debug("Starting compacting operation on journal");
// We need to guarantee that the journal is frozen for this short time
// We don't freeze the journal as we compact, only for the short time where
we replace records
@@ -1593,7 +1592,7 @@
renameFiles(dataFilesToProcess, newDatafiles);
deleteControlFile(controlFile);
- JournalImpl.log.debug("Finished compacting on journal");
+ JournalImpl.trace("Finished compacting on journal");
}
finally
@@ -2638,6 +2637,13 @@
*/
private void addFreeFile(final JournalFile file) throws Exception
{
+ if (file.getFile().size() != this.getFileSize())
+ {
+ // This will happen during cleanup
+ log.debug("Deleting " + file + ".. as it doesn't have the
standard size", new Exception ("trace"));
+ file.getFile().delete();
+ }
+ else
// FIXME - size() involves a scan!!!
if (freeFiles.size() + dataFiles.size() + 1 + openedFiles.size() < minFiles)
{