From: <wol...@us...> - 2006-06-25 20:50:43
|
Revision: 3736 Author: wolfgang_m Date: 2006-06-25 13:50:37 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/exist/?rev=3736&view=rev Log Message: ----------- Make crash recovery more robust: * journal reader failed to scan larger journal files (> 1GB). Don't use mapped byte buffer for reading the journal. Use an ordinary FileChannel/ByteBuffer instead. * on startup, we can immediately check if the last entry in the log is a checkpoint. we just need to scan the log if the last entry is not a checkpoint or is broken in some way. To check if it is valid, we store the current LSN into the checkpoint record and compare that to the current file offset when reading. Modified Paths: -------------- trunk/eXist-1.0/src/org/exist/storage/journal/JournalReader.java Modified: trunk/eXist-1.0/src/org/exist/storage/journal/JournalReader.java =================================================================== --- trunk/eXist-1.0/src/org/exist/storage/journal/JournalReader.java 2006-06-25 20:47:07 UTC (rev 3735) +++ trunk/eXist-1.0/src/org/exist/storage/journal/JournalReader.java 2006-06-25 20:50:37 UTC (rev 3736) @@ -147,6 +147,11 @@ transactId + "; at: " + Lsn.dump(lsn)); loggable.setLsn(lsn); + if (size + 2 > payload.capacity()) { + // resize the payload buffer + payload = ByteBuffer.allocate(size + 2); + } + payload.clear().limit(size + 2); fc.read(payload); payload.flip(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |