resolve issue with page file recovery replaying write buffer at wrong offest, also have schedualler flush writes on new store creation, issue visible with unclean shutdown - https://issues.apache.org/activemq/browse/AMQ-2935

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1004600 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2010-10-05 10:15:32 +00:00
parent 667f26a155
commit c94b4075e9
2 changed files with 3 additions and 3 deletions

View File

@ -201,6 +201,7 @@ public class JobSchedulerStore extends ServiceSupport {
if (isStarted()) {
result.start();
}
this.pageFile.flush();
}
return result;
}

View File

@ -335,7 +335,7 @@ public class PageFile {
loadFreeList();
}
} else {
LOG.debug("Recovering page file...");
LOG.debug(toString() + ", Recovering page file...");
nextTxid.set(redoRecoveryUpdates());
// Scan all to find the free pages.
@ -1107,8 +1107,7 @@ public class PageFile {
// Re-apply all the writes in the recovery buffer.
for (Map.Entry<Long, byte[]> e : batch.entrySet()) {
writeFile.seek(e.getKey());
e.getValue();
writeFile.seek(toOffset(e.getKey()));
writeFile.write(e.getValue());
}