Author: toad
Date: 2007-03-15 19:53:12 +0000 (Thu, 15 Mar 2007)
New Revision: 12134
Modified:
trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
Revert, and...
Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2007-03-15
19:51:32 UTC (rev 12133)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2007-03-15
19:53:12 UTC (rev 12134)
@@ -532,6 +532,8 @@
storeFile.createNewFile();
chkStore = new RandomAccessFile(storeFile,"rw");
+ boolean dontCheckOnShrink = false;
+
long chkBlocksInDatabase = chkDB.count();
chkBlocksInStore = chkBlocksInDatabase;
long chkBlocksFromFile = countCHKBlocksFromFile();
@@ -550,6 +552,7 @@
throw new DatabaseException("Keys in
database: "+chkBlocksInStore+" but keys in file: "+chkBlocksFromFile);
} else if(!noCheck) {
long len =
checkForHoles(chkBlocksFromFile, false);
+ dontCheckOnShrink = true;
if(len < chkBlocksFromFile) {
System.err.println("Truncating
to "+len+" as no non-holes after that point");
chkStore.setLength(len *
(dataBlockSize + headerBlockSize));
@@ -563,7 +566,7 @@
System.out.println("Keys in store: db
"+chkBlocksInDatabase+" file "+chkBlocksFromFile+" / max "+maxChkBlocks);
if(!noCheck) {
- maybeShrink(true, true);
+ maybeShrink(dontCheckOnShrink, true);
chkBlocksFromFile = countCHKBlocksFromFile();
chkBlocksInStore = Math.max(chkBlocksInStore,
chkBlocksFromFile);
}