jankotek / mapdb

MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.
https://mapdb.org
Apache License 2.0
4.87k stars 873 forks source link

IndexOutOfBoundsException on DB.commit() #1043

Open jordibuj opened 5 months ago

jordibuj commented 5 months ago

We've been using MapDB on our application for years now without any issue. Now we are on version 3.0.10. But yesterday we got this exception when committing an update:

java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
        at java.util.ArrayList.rangeCheck(ArrayList.java:659)
        at java.util.ArrayList.get(ArrayList.java:435)
        at java.util.Collections$SynchronizedList.get(Collections.java:2419)
        at org.mapdb.WriteAheadLog.walGetRecord(WriteAheadLog.java:863)
        at org.mapdb.StoreWAL$commit$4.value(StoreWAL.kt:634)
        at org.eclipse.collections.impl.map.mutable.primitive.LongLongHashMap.forEachKeyValue(LongLongHashMap.java:1066)
        at org.mapdb.StoreWAL.commit(StoreWAL.kt:633)
        at org.mapdb.DB.commit(DB.kt:435)
        at ch.mks.wta4.ui.SettingsManager.updateUserSettings(SettingsManager.java:75)
        ...

After that, some calls were ok while others gave similar errors both updating and getting data. We had to restore a backup from the day before. Any idea on what could have caused this error?