mirror of
https://github.com/postgres/postgres.git
synced 2026-04-20 22:00:13 -04:00
We've long contended with isolation test results that aren't entirely stable. Some test scripts insert long delays to try to force stable results, which is not terribly desirable; but other erratic failure modes remain, causing unrepeatable buildfarm failures. I've spent a fair amount of time trying to solve this by improving the server-side support code, without much success: that way is fundamentally unable to cope with diffs that stem from chance ordering of arrival of messages from different server processes. We can improve matters on the client side, however, by annotating the test scripts themselves to show the desired reporting order of events that might occur in different orders. This patch adds three types of annotations to deal with (a) test steps that might or might not complete their waits before the isolationtester can see them waiting; (b) test steps in different sessions that can legitimately complete in either order; and (c) NOTIFY messages that might arrive before or after the completion of a step in another session. We might need more annotation types later, but this seems to be enough to deal with the instabilities we've seen in the buildfarm. It also lets us get rid of all the long delays that were previously used, cutting more than a minute off the runtime of the isolation tests. Back-patch to all supported branches, because the buildfarm instabilities affect all the branches, and because it seems desirable to keep isolationtester's capabilities the same across all branches to simplify possible future back-patching of tests. Discussion: https://postgr.es/m/327948.1623725828@sss.pgh.pa.us
496 lines
13 KiB
Text
496 lines
13 KiB
Text
Parsed test spec with 2 sessions
|
|
|
|
starting permutation: s1b s2b1 s1l s2l s1u s1c s1ul s2c
|
|
step s1b: BEGIN;
|
|
step s2b1: BEGIN ISOLATION LEVEL READ COMMITTED;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s1c: COMMIT;
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: <... completed>
|
|
id value
|
|
|
|
1 one
|
|
2 two
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b1 s1l s1u s2l s1c s1ul s2c
|
|
step s1b: BEGIN;
|
|
step s2b1: BEGIN ISOLATION LEVEL READ COMMITTED;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1c: COMMIT;
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: <... completed>
|
|
id value
|
|
|
|
1 one
|
|
2 two
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b1 s1l s1u s1ul s2l s1c s2c
|
|
step s1b: BEGIN;
|
|
step s2b1: BEGIN ISOLATION LEVEL READ COMMITTED;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1c: COMMIT;
|
|
step s2l: <... completed>
|
|
id value
|
|
|
|
1 one
|
|
2 two
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b1 s1l s2l s1u s1c s1hint s1ul s2c
|
|
step s1b: BEGIN;
|
|
step s2b1: BEGIN ISOLATION LEVEL READ COMMITTED;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s1c: COMMIT;
|
|
step s1hint: SELECT * FROM lcku_table;
|
|
id value
|
|
|
|
1 one
|
|
2 two
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: <... completed>
|
|
id value
|
|
|
|
1 one
|
|
2 two
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b1 s1l s1u s2l s1c s1hint s1ul s2c
|
|
step s1b: BEGIN;
|
|
step s2b1: BEGIN ISOLATION LEVEL READ COMMITTED;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1c: COMMIT;
|
|
step s1hint: SELECT * FROM lcku_table;
|
|
id value
|
|
|
|
1 one
|
|
2 two
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: <... completed>
|
|
id value
|
|
|
|
1 one
|
|
2 two
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b1 s1l s1u s1ul s2l s1c s1hint s2c
|
|
step s1b: BEGIN;
|
|
step s2b1: BEGIN ISOLATION LEVEL READ COMMITTED;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1c: COMMIT;
|
|
step s2l: <... completed>
|
|
id value
|
|
|
|
1 one
|
|
2 two
|
|
step s1hint: SELECT * FROM lcku_table;
|
|
id value
|
|
|
|
1 one
|
|
2 two
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b2 s1l s2l s1u s1c s1ul s2c
|
|
step s1b: BEGIN;
|
|
step s2b2: BEGIN ISOLATION LEVEL REPEATABLE READ;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s1c: COMMIT;
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: <... completed>
|
|
ERROR: could not serialize access due to concurrent update
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b2 s1l s1u s2l s1c s1ul s2c
|
|
step s1b: BEGIN;
|
|
step s2b2: BEGIN ISOLATION LEVEL REPEATABLE READ;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1c: COMMIT;
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: <... completed>
|
|
ERROR: could not serialize access due to concurrent update
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b2 s1l s1u s1ul s2l s1c s2c
|
|
step s1b: BEGIN;
|
|
step s2b2: BEGIN ISOLATION LEVEL REPEATABLE READ;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1c: COMMIT;
|
|
step s2l: <... completed>
|
|
ERROR: could not serialize access due to concurrent update
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b2 s1l s2l s1u s1c s1hint s1ul s2c
|
|
step s1b: BEGIN;
|
|
step s2b2: BEGIN ISOLATION LEVEL REPEATABLE READ;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s1c: COMMIT;
|
|
step s1hint: SELECT * FROM lcku_table;
|
|
id value
|
|
|
|
1 one
|
|
2 two
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: <... completed>
|
|
ERROR: could not serialize access due to concurrent update
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b2 s1l s1u s2l s1c s1hint s1ul s2c
|
|
step s1b: BEGIN;
|
|
step s2b2: BEGIN ISOLATION LEVEL REPEATABLE READ;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1c: COMMIT;
|
|
step s1hint: SELECT * FROM lcku_table;
|
|
id value
|
|
|
|
1 one
|
|
2 two
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: <... completed>
|
|
ERROR: could not serialize access due to concurrent update
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b2 s1l s1u s1ul s2l s1c s1hint s2c
|
|
step s1b: BEGIN;
|
|
step s2b2: BEGIN ISOLATION LEVEL REPEATABLE READ;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1c: COMMIT;
|
|
step s2l: <... completed>
|
|
ERROR: could not serialize access due to concurrent update
|
|
step s1hint: SELECT * FROM lcku_table;
|
|
id value
|
|
|
|
1 one
|
|
2 two
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b3 s1l s2l s1u s1c s1ul s2c
|
|
step s1b: BEGIN;
|
|
step s2b3: BEGIN ISOLATION LEVEL SERIALIZABLE;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s1c: COMMIT;
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: <... completed>
|
|
ERROR: could not serialize access due to concurrent update
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b3 s1l s1u s2l s1c s1ul s2c
|
|
step s1b: BEGIN;
|
|
step s2b3: BEGIN ISOLATION LEVEL SERIALIZABLE;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1c: COMMIT;
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: <... completed>
|
|
ERROR: could not serialize access due to concurrent update
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b3 s1l s1u s1ul s2l s1c s2c
|
|
step s1b: BEGIN;
|
|
step s2b3: BEGIN ISOLATION LEVEL SERIALIZABLE;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1c: COMMIT;
|
|
step s2l: <... completed>
|
|
ERROR: could not serialize access due to concurrent update
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b3 s1l s2l s1u s1c s1hint s1ul s2c
|
|
step s1b: BEGIN;
|
|
step s2b3: BEGIN ISOLATION LEVEL SERIALIZABLE;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s1c: COMMIT;
|
|
step s1hint: SELECT * FROM lcku_table;
|
|
id value
|
|
|
|
1 one
|
|
2 two
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: <... completed>
|
|
ERROR: could not serialize access due to concurrent update
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b3 s1l s1u s2l s1c s1hint s1ul s2c
|
|
step s1b: BEGIN;
|
|
step s2b3: BEGIN ISOLATION LEVEL SERIALIZABLE;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1c: COMMIT;
|
|
step s1hint: SELECT * FROM lcku_table;
|
|
id value
|
|
|
|
1 one
|
|
2 two
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: <... completed>
|
|
ERROR: could not serialize access due to concurrent update
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
|
|
starting permutation: s1b s2b3 s1l s1u s1ul s2l s1c s1hint s2c
|
|
step s1b: BEGIN;
|
|
step s2b3: BEGIN ISOLATION LEVEL SERIALIZABLE;
|
|
step s1l: SELECT pg_advisory_lock(578902068);
|
|
pg_advisory_lock
|
|
|
|
|
|
step s1u: UPDATE lcku_table SET id = 2 WHERE id = 3;
|
|
step s1ul: SELECT pg_advisory_unlock(578902068);
|
|
pg_advisory_unlock
|
|
|
|
t
|
|
step s2l: SELECT * FROM lcku_table WHERE pg_advisory_lock(578902068) IS NOT NULL FOR KEY SHARE; <waiting ...>
|
|
step s1c: COMMIT;
|
|
step s2l: <... completed>
|
|
ERROR: could not serialize access due to concurrent update
|
|
step s1hint: SELECT * FROM lcku_table;
|
|
id value
|
|
|
|
1 one
|
|
2 two
|
|
step s2c: COMMIT;
|
|
pg_advisory_unlock_all
|
|
|
|
|
|
pg_advisory_unlock_all
|
|
|
|
|