setup { CREATE TABLE t (k int PRIMARY KEY, c int); INSERT INTO t VALUES (1, 1); CREATE EXTENSION pageinspect; } teardown { DROP EXTENSION pageinspect; DROP TABLE t; } session "updater" step "u_begin" { BEGIN ISOLATION LEVEL READ COMMITTED; SELECT txid_current(); } step "u_regupd" { UPDATE t SET c = 5; } step "u_abort" { ROLLBACK; } step "u_keyupd" { UPDATE t SET k = 2; } session "locker" step "l_begin" { BEGIN ISOLATION LEVEL READ COMMITTED; SELECT txid_current(); } step "l_keylck" { SELECT * FROM t FOR KEY SHARE; } step "l_commit" { COMMIT; } session "spectator" step "s_vacfrz" { VACUUM FREEZE t; } step "s_incxid" { SELECT txid_current(); } step "s_snap" { SELECT txid_current_snapshot(); } step "s_cutoff" { SELECT relfrozenxid, relminmxid FROM pg_class WHERE oid = 't'::regclass; } step "s_tuphdr" { select lp, t_xmin, t_xmax, to_hex(t_infomask) as mask, to_hex(t_infomask2) as mask2 from heap_page_items(get_raw_page('t', 0)); } # Key lock must block key update. Works in master, 9.3.2, and 9.3.1. permutation "l_begin" "l_keylck" "u_begin" "u_keyupd" "l_commit" "u_abort" # Concurrently update and key-lock; abort the update; VACUUM FREEZE; try a key # update. Key lock must remain outstanding and block the key update. Works # in 9.3.1. Fails in master and 9.3.2: VACUUM FREEZE leaves the affected # tuple with t_infomask 0x900, unlocked. permutation "u_begin" "u_regupd" "l_begin" "l_keylck" "u_abort" "s_vacfrz" "s_tuphdr" "u_keyupd" "l_commit" # Previous permutation, minus the VACUUM FREEZE. Again, key lock must remain # outstanding and block the key update. Works in 9.3.1. master and 9.3.2 hit # an assertion failure during u_keyupd: # # TRAP: FailedAssertion("!(((OldestMemberMXactId[MyBackendId]) != ((MultiXactId) 0)))", File: "multixact.c", Line: 868) permutation "u_begin" "u_regupd" "l_begin" "l_keylck" "u_abort" "u_keyupd" "l_commit"