Permalink
Browse files

https://jira.jboss.org/browse/HORNETQ-399 - cleanup files shouldn't b…

…e reused after freed
  • Loading branch information...
1 parent a73f9c4 commit 5aa22d3bbb7124d9f2773bacfddb5ee80a177da5 @clebertsuconic clebertsuconic committed May 29, 2010
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/main/org/hornetq/core/journal/impl/JournalImpl.java
@@ -1453,7 +1453,6 @@ public synchronized void compact() throws Exception
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 @@ public synchronized void compact() throws Exception
renameFiles(dataFilesToProcess, newDatafiles);
deleteControlFile(controlFile);
- JournalImpl.log.debug("Finished compacting on journal");
+ JournalImpl.trace("Finished compacting on journal");
}
finally
@@ -2638,6 +2637,13 @@ protected void onCompactDone()
*/
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)
{

0 comments on commit 5aa22d3

Please sign in to comment.