[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: LMDB: MDB_MAP_FULL doesn't allow deletions



Although I didn't figure out a good way to do what I want, this is what I am
now doing:

if (MDB_MAP_FULL while putting) {
  abort txn, close the database
  reopen the database @ larger mapsize
  perform some pruning of dead records
  commit txn, close the database
  reopen the database @ old mapsize
  try to put again 
}

At this point, the database is probably larger than the old mapsize. To handle
that, I make a copy  of the DB, kill the original, open a new database and
copy the records from the old DB to the  new one.

All of this is a lot more complicated and code-verbose than I want, but it
works and seems to be reliable.

Nevertheless, if there's an easier way, I'm all ears. Thanks for your
thoughts.

Jeremy