Hi Chee, Thanks for v3. I tested it on master at 7fc2f0423320 (Debian container, gcc 14.2, --enable-cassert --enable-debug --enable-tap-tests). Your v3 mail reached me directly and is not in the archive thread yet, so I reply to my last message here.
- Both patches apply with git apply, and git diff --check reports nothing. The build has 0 warnings. - make check: 243 of 243. Isolation: 139 of 139. contrib pageinspect (8), amcheck (4, TAP 298 subtests), pgrowlocks (1), pg_visibility (1): all pass. - I ran my earlier tuple-state and concurrency scripts again. The pageinspect dumps and the lock timeouts are the same as with v2 on the old master: same-XID cases give xmax = 0 with HEAP_XMAX_INVALID, and the different-subtransaction and MultiXact cases stay on the old path. verify_heapam reports 0 rows, and the server log has no WARNING or TRAP. Comments on the README.tuplock text in 0002, from reading it against the code. I found no factual error, only wording: 1. "That representation is enough for the case that needs carrying: a different transaction's FOR KEY SHARE lock" does not mention a locker in a different subtransaction or a MultiXact, which the last sentence says still carry. 2. The text says the safety does not depend on comparing lock strengths. That is right. It may help to say the test is HEAP_XMAX_IS_LOCKED_ONLY(infomask) && xwait == xid. 3. "LOCK_ONLY" and "KEYSHR_LOCK | LOCK_ONLY" appear without the HEAP_XMAX_ prefix in two paragraphs, and the other paragraphs use the full name. 4. The paragraph "The same-XID case is redundant for a simpler reason" could say that if the subtransaction aborts, the xmin of the new version aborts too. What I did not test: check-world, injection points, other platforms (one Linux build), standby and replication, pg_upgrade, a long concurrent load, extensions that read xmax (pg_surgery, pgstattuple, pg_walinspect), deeper nested subtransactions, and partitioned tables or FK triggers on many rows. I only read the README text, there is no test for it. Regards, Joao Rito
