diff options
| author | Alexander Korotkov | 2024-02-16 01:36:38 +0000 |
|---|---|---|
| committer | Alexander Korotkov | 2024-02-16 01:36:38 +0000 |
| commit | bf82f43790a675dd1b9522a7799357e61e7aa635 (patch) | |
| tree | 07c459ce59aadc3b8157112635c736976685ae20 /src/test | |
| parent | 51efe38cb92f4b15b68811bcce9ab878fbc71ea5 (diff) | |
Followup fixes for transaction_timeout
Don't deal with transaction timeout in PostgresMain(). Instead, release
transaction timeout activated by StartTransaction() in
CommitTransaction()/AbortTransaction()/PrepareTransaction(). Deal with both
enabling and disabling transaction timeout in assign_transaction_timeout().
Also, remove potentially flaky timeouts-long isolation test, which has no
guarantees to pass on slow/busy machines.
Reported-by: Andres Freund
Discussion: https://postgr.es/m/20240215230856.pc6k57tqxt7fhldm%40awork3.anarazel.de
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/isolation/isolation_schedule | 1 | ||||
| -rw-r--r-- | src/test/isolation/specs/timeouts-long.spec | 35 |
2 files changed, 0 insertions, 36 deletions
diff --git a/src/test/isolation/isolation_schedule b/src/test/isolation/isolation_schedule index 86ef62bbcf6..b2be88ead1d 100644 --- a/src/test/isolation/isolation_schedule +++ b/src/test/isolation/isolation_schedule @@ -89,7 +89,6 @@ test: sequence-ddl test: async-notify test: vacuum-no-cleanup-lock test: timeouts -test: timeouts-long test: vacuum-concurrent-drop test: vacuum-conflict test: vacuum-skip-locked diff --git a/src/test/isolation/specs/timeouts-long.spec b/src/test/isolation/specs/timeouts-long.spec deleted file mode 100644 index ce2c9a43011..00000000000 --- a/src/test/isolation/specs/timeouts-long.spec +++ /dev/null @@ -1,35 +0,0 @@ -# Tests for transaction timeout that require long wait times - -session s7 -step s7_begin -{ - BEGIN ISOLATION LEVEL READ COMMITTED; - SET transaction_timeout = '1s'; -} -step s7_commit_and_chain { COMMIT AND CHAIN; } -step s7_sleep { SELECT pg_sleep(0.6); } -step s7_abort { ABORT; } - -session s8 -step s8_begin -{ - BEGIN ISOLATION LEVEL READ COMMITTED; - SET transaction_timeout = '900ms'; -} -# to test that quick query does not restart transaction_timeout -step s8_select_1 { SELECT 1; } -step s8_sleep { SELECT pg_sleep(0.6); } - -session checker -step checker_sleep { SELECT pg_sleep(0.3); } -step s7_check { SELECT count(*) FROM pg_stat_activity WHERE application_name = 'isolation/timeouts/s7'; } -step s8_check { SELECT count(*) FROM pg_stat_activity WHERE application_name = 'isolation/timeouts/s8'; } - -# COMMIT AND CHAIN must restart transaction timeout -permutation s7_begin s7_sleep s7_commit_and_chain s7_sleep s7_check s7_abort -# transaction timeout expires in presence of query flow, session s7 FATAL-out -# this relatevely long sleeps are picked to ensure 300ms gap between check and timeouts firing -# expected flow: timeouts is scheduled after s8_begin and fires approximately after checker_sleep (300ms before check) -# possible buggy flow: timeout is schedules after s8_select_1 and fires 300ms after s8_check -# to ensure this 300ms gap we need minimum transaction_timeout of 300ms -permutation s8_begin s8_sleep s8_select_1 s8_check checker_sleep checker_sleep s8_check |
