On Mon, 2017-10-16 at 11:51 +0100, Howard Chu wrote:
It appears that it couldn't mark a page as dirty. Here is the relevant assertion from mdb_page_dirty: rc = insert(txn->mt_u.dirty_list, &mid); mdb_tassert(txn, rc == 0); // assertion failed
What might I be doing wrong in my application that triggers this sort of error?
Take a look at the value of rc, then look in midl.c.
I've taken a look. The value of rc is -1, which according to the mdb_mid2l_insert code means that it's a duplicate value, so the page is already in the txn's dirty pages list.
Since it comes from an mdb_page_alloc call, it is a bit weird that the newly allocated page is already on the list, but maybe it's a reused page?
Most likely the dirty list is too big, which means you're trying to do too much in a single transaction.
The code did work on the compacted database, and it was doing exactly the same operations on it, so this was unlikely.
- Timur