Closed SatoKentaNayoro closed 1 year ago
Hey @hxuchen 👋
Heed keeps the type the databases were opened with e.g. Database<Str, SerdeJson<MyStruct>>
. So, when you try to open a database from the same Env
, you get this error. It doesn't mean there is corruption but that you tried opening a known database with another type, e.g. Database<U32, Str>
.
🙋 Does the
database was previously opened with different types
error imply that the database might be corrupted? When I exit the program, an errorMDB_BAD_DBI: The specified DBI handle was closed/changed unexpectedly
is thrown (likely during commit), and then every time I reopen and access this database, I see thedatabase was previously opened with different types
error. By the way, my original code didn't useenv.prepare_for_closing().wait()
; I'm not sure if that's the reason the exception occurs upon program exit. If the database is indeed corrupted, are there any effective methods for repairing it?🙏