Author: toad
Date: 2007-03-24 18:18:42 +0000 (Sat, 24 Mar 2007)
New Revision: 12319
Modified:
trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
More blocks in store than file => some dupes => check for holes
Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2007-03-24
18:08:56 UTC (rev 12318)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2007-03-24
18:18:42 UTC (rev 12319)
@@ -539,7 +539,15 @@
chkBlocksInStore = chkBlocksInDatabase;
long chkBlocksFromFile = countCHKBlocksFromFile();
lastRecentlyUsed = getMaxRecentlyUsed();
+
+ System.out.println("Keys in store: db
"+chkBlocksInDatabase+" file "+chkBlocksFromFile+" / max "+maxChkBlocks);
+ if(chkBlocksInDatabase > chkBlocksFromFile) {
+ System.out.println("More keys in database than
in store, checking for holes...");
+ dontCheckForHolesShrinking = true;
+ checkForHoles(chkBlocksFromFile, false);
+ }
+
if(((chkBlocksInStore == 0) && (chkBlocksFromFile !=
0)) ||
(((chkBlocksInStore + 10) * 1.1) <
chkBlocksFromFile)) {
if(throwOnTooFewKeys) {
@@ -564,7 +572,6 @@
chkBlocksInStore = Math.max(chkBlocksInStore,
chkBlocksFromFile);
if(logMINOR) Logger.minor(this, "Keys in store:
"+chkBlocksInStore);
- System.out.println("Keys in store: db
"+chkBlocksInDatabase+" file "+chkBlocksFromFile+" / max "+maxChkBlocks);
if(!noCheck) {
maybeOfflineShrink(dontCheckForHolesShrinking);