Howard Chu writes:
Hallvard Breien Furuseth wrote:
I wrote:
One thing about ACID - IIRC there are some potential data races which my single-word meta info in the header will fix. E.g. if the user does ^Z at an unfortunate time, and with WRITEMAP updating the meta page while a txn is reading it.
Reproducible by sending frequent SIGSTOPs and SIGCONTs, with mdb.c patched to verify (memcmp or checksum) the meta info after copying. Happens even with 1 MDB process.
(Re comments elsewhere: Selecting a meta page is atomic, but copying/writing it is not.)
True, but writing the meta page doesn't need to be atomic - it won't be considered current until its txnid is updated. Until then, its txnid will be less than the other page's anyway.
I did test it. Maybe the signal caught a reader in the middle of copying a meta page, then several write transactions changed both metas.
I see WRITEMAP can only be relevant if something reoders some accesses, which I see no particular reason to happen in this case. Or at least not compared to reordering meta page vs. me_txns->mti_txnid access.