Fixed storage initialization record count offset
This commit is contained in:
parent
c3f8ad3a6e
commit
0c5d5e2ef8
@ -187,8 +187,9 @@ class StorageBase {
|
|||||||
this.memoryIndex.put(meta.key, meta);
|
this.memoryIndex.put(meta.key, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.memoryIndex.size() != this.numberOfRecords) {
|
// offset by one, because numberOfRecords counts from 1, and memoryIndex.size() is from 0
|
||||||
setRecordCount(this.randomAccessFile, this.memoryIndex.size());
|
if (this.memoryIndex.size() + 1 != (this.numberOfRecords)) {
|
||||||
|
setRecordCount(this.randomAccessFile, this.memoryIndex.size() + 1);
|
||||||
if (logger != null) {
|
if (logger != null) {
|
||||||
logger.warn("Mismatch record count in storage, auto-correcting size.");
|
logger.warn("Mismatch record count in storage, auto-correcting size.");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user