Re: Transaction timeout
Andrey Borodin <amborodin86@gmail.com>
From: Andrey Borodin <amborodin86@gmail.com>
To: Nikolay Samokhvalov <samokhvalov@gmail.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>,
Andres Freund <andres@anarazel.de>, Michael Paquier <michael.paquier@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-01-13T18:15:56Z
Lists: pgsql-hackers
Thanks for the review Nikolay! On Fri, Jan 13, 2023 at 8:03 AM Nikolay Samokhvalov <samokhvalov@gmail.com> wrote: > > 1) The current test set has only 2 simple cases – I'd suggest adding one more (that one that didn't work in v1): > > gitpod=# set transaction_timeout to '20ms'; > SET > gitpod=# begin; select pg_sleep(.01); select pg_sleep(.01); select pg_sleep(.01); commit; I tried exactly these tests - tests were unstable on Windows. Maybe that OS has a more coarse-grained timer resolution. It's a tradeoff between time spent on tests, strength of the test and probability of false failure. I chose small time without false alarms. > – it seems we could (should) have one more successful "1s wait, 3s sleep" iteration here, ~727ms somehow wasted in a loop, quite a lot. I think big chunk from these 727ms were spent between "BEGIN" and "select now(), clock_timestamp(), pg_sleep(3) \watch 1". I doubt patch really contains arithmetic errors. Many thanks for looking into this! Best regards, Andrey Borodin.
Commits
-
Add TAP tests for timeouts
- eeefd4280f6e 17.0 landed
-
Remove flaky isolation tests for timeouts
- a661bf7b0f56 17.0 landed
-
Followup fixes for transaction_timeout
- bf82f43790a6 17.0 landed
-
Introduce transaction_timeout
- 51efe38cb92f 17.0 landed
-
On systems that have setsid(2) (which should be just about everything except
- 3ad0728c817b 8.2.0 cited