serverLog.logSevere("kelondroCollectionIndex","UPDATE (put) ERROR: array has different chunkcount than index after merge: index = "+(int)indexrow.getColLong(idx_col_chunkcount)+", collection.size() = "+collection.size());
if(this.indexErrors==errorLimit)deleteIndexOnExit();// delete index on exit for rebuild
serverLog.logSevere("kelondroCollectionIndex","UPDATE (put) ERROR: array has different chunkcount than index after merge: index = "+(int)indexrow.getColLong(idx_col_chunkcount)+", collection.size() = "+collection.size()+" (error #"+indexErrors+")");
}
index.put(indexrow);// write modified indexrow
}
@ -562,9 +567,11 @@ public class kelondroCollectionIndex {
finalintcollectionsize=collection.size();// extra variable for easier debugging
serverLog.logSevere("kelondroCollectionIndex","UPDATE (merge) ERROR: array has different chunkcount than index after merge: index = "+indexrowcount+", collection.size() = "+collectionsize);
if(indexrowcount!=collectionsize){
this.indexErrors++;
if(this.indexErrors==errorLimit)deleteIndexOnExit();// delete index on exit for rebuild
serverLog.logSevere("kelondroCollectionIndex","UPDATE (merge) ERROR: array has different chunkcount than index after merge: index = "+indexrowcount+", collection.size() = "+collectionsize+" (error #"+indexErrors+")");
}
index.put(indexrow);// write modified indexrow
}
}
@ -750,7 +757,12 @@ public class kelondroCollectionIndex {
if(arrayrow==null)thrownewkelondroException(arrayFile(this.path,this.filenameStub,this.loadfactor,chunksize,clusteridx,serialnumber).toString(),"array does not contain expected row");
if(arrayrow==null){
// the index appears to be corrupted
this.indexErrors++;
if(this.indexErrors==errorLimit)deleteIndexOnExit();// delete index on exit for rebuild
thrownewkelondroException(arrayFile(this.path,this.filenameStub,this.loadfactor,chunksize,clusteridx,serialnumber).toString(),"array does not contain expected row (error #"+indexErrors+")");
@ -759,7 +771,9 @@ public class kelondroCollectionIndex {
// cleanup for a bad bug that corrupted the database
index.remove(indexkey);// the RowCollection must be considered lost
array.remove(rownumber);// loose the RowCollection (we don't know how much is lost)
serverLog.logSevere("kelondroCollectionIndex."+array.filename,"lost a RowCollection because of a bad arraykey");
this.indexErrors++;
if(this.indexErrors==errorLimit)deleteIndexOnExit();// delete index on exit for rebuild
serverLog.logSevere("kelondroCollectionIndex."+array.filename,"lost a RowCollection because of a bad arraykey (error #"+indexErrors+")");
returnnewkelondroRowSet(this.payloadrow,0);
}
finalkelondroRowSetcollection=newkelondroRowSet(this.payloadrow,arrayrow,1);// FIXME: this does not yet work with different rowdef in case of several rowdef.objectsize()
@ -777,14 +791,18 @@ public class kelondroCollectionIndex {
serverLog.logSevere("kelondroCollectionIndex."+array.filename,"array contains wrong row '"+newString(arrayrow.getColBytes(0))+"', expected is '"+newString(indexrow.getColBytes(idx_col_key))+"', the row has been fixed");
this.indexErrors++;
if(this.indexErrors==errorLimit)deleteIndexOnExit();// delete index on exit for rebuild
serverLog.logSevere("kelondroCollectionIndex."+array.filename,"array contains wrong row '"+newString(arrayrow.getColBytes(0))+"', expected is '"+newString(indexrow.getColBytes(idx_col_key))+"', the row has been fixed (error #"+indexErrors+")");
array.logFailure("INCONSISTENCY (get) in "+arrayFile(this.path,this.filenameStub,this.loadfactor,chunksize,clusteridx,serialnumber).toString()+": array has different chunkcount than index: index = "+chunkcount+", array = "+chunkcountInArray+"; the index has been auto-fixed");
this.indexErrors++;
if(this.indexErrors==errorLimit)deleteIndexOnExit();// delete index on exit for rebuild
array.logFailure("INCONSISTENCY (get) in "+arrayFile(this.path,this.filenameStub,this.loadfactor,chunksize,clusteridx,serialnumber).toString()+": array has different chunkcount than index: index = "+chunkcount+", array = "+chunkcountInArray+"; the index has been auto-fixed (error #"+indexErrors+")");
}
if(remove)array.remove(rownumber);// index is removed in calling method