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

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2396 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent 79f27c298e
commit 6d2f15971a

@ -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);
}

@ -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);
}

@ -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();
}

Loading…
Cancel
Save