Author: toad
Date: 2007-03-06 22:39:10 +0000 (Tue, 06 Mar 2007)
New Revision: 12001

Modified:
   trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
Investigate a bit and maybe fix _ph00's datastore problem

Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2007-03-06 
18:30:51 UTC (rev 12000)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2007-03-06 
22:39:10 UTC (rev 12001)
@@ -660,14 +660,14 @@
        long newSize = maxChkBlocks;
        if(chkBlocksInStore < maxChkBlocks) return;

+       System.err.println("Shrinking from "+chkBlocksInStore+" to 
"+maxChkBlocks+" (from db "+countCHKBlocksFromDatabase()+" from file 
"+countCHKBlocksFromFile()+ ')');
+       
        checkForHoles(maxChkBlocks, true);

        WrapperManager.signalStarting(5*60*1000 + (int)chkBlocksInStore * 100); 
// 10 per second

        long realSize = countCHKBlocksFromFile();

-       System.err.println("Shrinking from "+chkBlocksInStore+" to 
"+maxChkBlocks+" (from db "+countCHKBlocksFromDatabase()+" from file 
"+countCHKBlocksFromFile()+ ')');
-       
        try {
                        c = chkDB_accessTime.openCursor(null,null);

@@ -991,6 +991,7 @@
                } catch (DatabaseException e) {
                        Logger.error(this, "Could not remove old database 
blocknum: "+e, e);
                }
+               System.err.println("Removed old database "+prefix);

                // Initialize CHK database
                DatabaseConfig dbConfig = new DatabaseConfig();
@@ -1067,6 +1068,7 @@
                Logger.error(this, "Reconstructing store index from store file: 
type="+type);
                byte[] header = new byte[headerBlockSize];
                byte[] data = new byte[dataBlockSize];
+               chkBlocksInStore = 0;
                try {
                        chkStore.seek(0);
                        long l = 0;
@@ -1113,6 +1115,7 @@
                                }
                        }
                } catch (EOFException e) {
+                       System.err.println("Caught EOF, migrating...");
                        migrate();
                        return;
                } catch (IOException e) {


Reply via email to