Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

there is a very strange error that causes that the kelondroRecords structure is corrupted. The cause is, that the deleted-records-chain has wrong entries, and one of the pointers in that chain points to a place behind the file end. This causes an IndexOutOfBoundsException within an IO operation. I currently don't know the reason that the deleted-records-chain is corrupted, but the error can be catched. If this now happens with the assortment database, the database is deleted. See also: http://www.yacy-forum.de/viewtopic.php?p=24586#24586

orbiter6d2f15971a8f
diff --git a/source/de/anomic/data/listManager.java b/source/de/anomic/data/listManager.java
index 9516de6e3..1e6e4b197 100644
--- a/source/de/anomic/data/listManager.java
+++ b/source/de/anomic/data/listManager.java
@@ -193,8 +193,6 @@ public class listManager {
// get a Directory Listing as a String Array
public static String[] getDirListing(String dirname){
- String[] fileListString;
- File[] fileList;
final File dir = new File(dirname);
return getDirListing(dir);
}
diff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.java
index 0c14160b1..5fa7dc7aa 100644
--- a/source/de/anomic/plasma/plasmaWordIndex.java
+++ b/source/de/anomic/plasma/plasmaWordIndex.java
@@ -201,8 +201,8 @@ public final class plasmaWordIndex extends indexAbstractRI implements indexRI {
public void flushCacheSome() {
synchronized (ramCache) { ramCache.shiftK2W(); }
- int flushCount = ramCache.wSize() / 350;
- if (flushCount > 80) flushCount = 80;
+ int flushCount = ramCache.wSize() / 400;
+ if (flushCount > 200) flushCount = 200;
if (flushCount < 20) flushCount = Math.min(20, ramCache.wSize());
flushCache(flushCount);
}
diff --git a/source/de/anomic/plasma/plasmaWordIndexAssortment.java b/source/de/anomic/plasma/plasmaWordIndexAssortment.java
index 031f4d60f..72fc88e41 100644
--- a/source/de/anomic/plasma/plasmaWordIndexAssortment.java
+++ b/source/de/anomic/plasma/plasmaWordIndexAssortment.java
@@ -133,6 +133,8 @@ public final class plasmaWordIndexAssortment {
return;
} catch (IOException e){
serverLog.logSevere("PLASMA", "unable to open assortment database " + assortmentLength + ", creating new: " + e.getMessage(), e);
+ } catch (IndexOutOfBoundsException e){
+ serverLog.logSevere("PLASMA", "assortment database " + assortmentLength + " corupted, creating new: " + e.getMessage(), e);
} catch (kelondroException e) {
serverLog.logSevere("PLASMA", "assortment database " + assortmentLength + " corupted, creating new: " + e.getMessage(), e);
}
@@ -163,9 +165,15 @@ public final class plasmaWordIndexAssortment {
try {
oldrow = assortments.put(row);
} catch (IOException e) {
+ e.printStackTrace();
+ log.logSevere("storeAssortment/IO-error: " + e.getMessage() + " - reset assortment-DB " + assortments.file(), e);
+ resetDatabase();
+ } catch (IndexOutOfBoundsException e) {
+ e.printStackTrace();
log.logSevere("storeAssortment/IO-error: " + e.getMessage() + " - reset assortment-DB " + assortments.file(), e);
resetDatabase();
} catch (kelondroException e) {
+ e.printStackTrace();
log.logSevere("storeAssortment/kelondro-error: " + e.getMessage() + " - reset assortment-DB " + assortments.file(), e);
resetDatabase();
}