kriszyp / lmdb-js

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

at getRangeFromIndex.next (<anonymous>)"},"msg":"Data read, but end of buffer not reached 0" #224

Closed anywhichway closed 1 year ago

anywhichway commented 1 year ago

Any idea what would cause this type of error? "at getRangeFromIndex.next ()"},"msg":"Data read, but end of buffer not reached 0". The error is actually generated when db.getRange is called inside getRangeFromIndex.

It is hard to duplicate, but it only occurs in a clustered environment. The cluster is not under load, the error occurs when running unit tests.

kriszyp commented 1 year ago

I am not sure what would cause this, but I think one thing is trying to iterate through a range in the root database than contains sub databases (sub-databases are entries with LMDB-specific data that can't be decoded). It sounds like it is trying to read an entry that starts with zero(s), which I believe would match with database entriess. Another issues that sometimes cause some problems is doing a range over a whole database without excluding the Symbol(structures) that contains the shared structures entry.

anywhichway commented 1 year ago

Thanks. I think it was the Symbol thing. I reworked my code and the issue had gone away.