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

Re: MDB_PAGE_FULL



Hi,

I was already on that revision.

The problems goes away by using mdb_del instead. However I am still getting strange behaviour. In particular on deletion. It seems as though the cursor gets confused when the data it refers to has been removed.

Unfortunately I am unable to reproduce the error in a simple scenario. It is happening from java code calling lmdb via JNI.

In general I keep a cursor open on the db. Then I remove an entry and after that call MDB_NEXT on the cursor. Occasionally it then crashes.

I noticed that before it crashes it enters the following code in mdb_cursor_next

static int mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) {
...


skip:

...


(line 5098)    if (F_ISSET(leaf->mn_flags, F_DUPDATA)) {
                        mdb_xcursor_init1(mc, leaf);       //this crashes
                    }
...
}

Trying to duplicate the error from c I can not get that code to execute.

Any pointers as to what I might be doing incorrect?
When removing data, can MDB_NEXT be called or should the cursor be reset first?

Thanks
Pieter



On 23/12/2013 15:55, Howard Chu wrote:
Pieter Martin wrote:
Hi,

I am using lmdb to implement a graph db via java JNI.
Initial results are amazing.

Anyhow I am having trouble with deletions.

I am getting MDB_PAGE_FULL when trying to delete.

Sounds like ITS#7756, you should try with git rev b77689f97572980d5de729e2fe6d8a5e6e9d6218


A simplified version of the code is as follows.


      //set the key
      ...

      while ((rc = mdb_cursor_get(vertexCursor, &key, &data,
MDB_SET_RANGE)) == 0) {

                  rc = mdb_cursor_del(vertexCursor, 0);
                  if (rc != 0) {
                      printf("removeVertex 4 %i\n", rc);
                      goto fail;
                  }

                  //set the key
                  ...
      }

The mdb_cursor_del returns a error code -30786 (MDB_PAGE_FULL) on about
the 38th loop.

if there are very few entries then the exception does not happen.
Is there something obvious that I am doing wrong to cause a
MDB_PAGE_FULL exception?

Thanks
Pieter