kriszyp / lmdb-js

Simple, efficient, ultra-fast, scalable data store wrapper for LMDB
Other
482 stars 39 forks source link

MDB_PANIC error when overlappingSync is enabled #140

Closed kylebernhardy closed 2 years ago

kylebernhardy commented 2 years ago

I am trying to pinpoint the exact scenario that is causing this error to be thrown, so I apologize for not having repro steps at this time. I did want to see if you know of any where that overlappingSync would be causing this error to throw. I will follow up with steps once I identify what is causing this to occur.

kylebernhardy commented 2 years ago

On further trialing I found I had some old code that was still setting noSync = false. For environment open / creation. Removing this code seemed to fix this error. Strange that this would create a weird side effect.

kriszyp commented 2 years ago

From the code, my understanding was MDB_PANIC was only caused by a disk write failure or a failure to acquire a lock. Is this reproducible by creating a db with noSync and then opening again with overlappingSync? (that certainly should be supported.)

kylebernhardy commented 2 years ago

We are always creating & opening with overLappingSync. I'm still trying to figure out what is leading to this issue. But this stack trace comes up pretty consistently:

Error: MDB_PANIC: Update of meta page failed or environment had fatal error at renewReadTxn (/home/ubuntu/harperdb/node_modules/lmdb/dist/index.cjs:1806:20) at resetCursor (/home/ubuntu/harperdb/node_modules/lmdb/dist/index.cjs:1549:53) at RangeIterable.iterable.iterate (/home/ubuntu/harperdb/node_modules/lmdb/dist/index.cjs:1571:5) at RangeIterable.[Symbol.iterator] (/home/ubuntu/harperdb/node_modules/lmdb/dist/index.cjs:1132:31)

kylebernhardy commented 2 years ago

I think I have a bad implementation on my branch, I apologize for raising this.