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

Re: (ITS#7774) LMDB assertion failure during Postfix cache cleanup

This is a follow-up question, not a request to reopen the issue.

It is about what happens when different processes open the same
database with MDB_NOLOCK, and then perform the exact same operations
that were the subject of ITS#7774.

Brief summary of ITS#7774: when an LMDB database is opened with
MDB_NOLOCK, a long-lived cursor's read transaction triggers an
assertion when the same process performs a delete transaction on a
different database element. This happened when walking an LMDB-based
cache to remove "expired" entries.

    The application uses fcntl() shared locks around cursor_get()
    and mdb_get() including all related MDB operations, and it uses
    fcntl() exclusive locks around mdb_put() and mdb_del() including
    all related MDB operations.

The solution was to close the long-lived cursor's read transaction
before the delete operation.

Now my question: what happens when the two above activities happen
in different processes? That is, process A (opens the database with
MDB_NOLOCK. opens a cursor, and walks the database without making
any changes to it), while process B opens the same database with
MDB_NOLOCK and performs the delete transactions.

Will the process A cursor read transaction trigger an assertion due
to the process B delete transactions? If not, why not?