Re: Transaction timeout
Alexander Korotkov <aekorotkov@gmail.com>
From: Alexander Korotkov <aekorotkov@gmail.com>
To: Andrey Borodin <x4mmm@yandex-team.ru>
Cc: Japin Li <japinli@hotmail.com>, Peter Smith <smithpb2250@gmail.com>, Junwang Zhao <zhjwpku@gmail.com>, 邱宇航 <iamqyh@gmail.com>, Fujii Masao <masao.fujii@oss.nttdata.com>, Andrew Borodin <amborodin86@gmail.com>, Andres Freund <andres@anarazel.de>, Michael Paquier <michael.paquier@gmail.com>, Nikolay Samokhvalov <samokhvalov@gmail.com>, pgsql-hackers mailing list <pgsql-hackers@postgresql.org>, pgsql-hackers mailing list <pgsql-hackers@lists.postgresql.org>
Date: 2024-02-13T21:42:35Z
Lists: pgsql-hackers
Attachments
- 0001-Introduce-transaction_timeout-v26.patch (application/octet-stream) patch v26-0001
Hi! On Wed, Jan 31, 2024 at 11:57 AM Andrey Borodin <x4mmm@yandex-team.ru> wrote: > > On 31 Jan 2024, at 14:27, Japin Li <japinli@hotmail.com> wrote: > > > > LGTM. > > > > If there is no other objections, I'll change it to ready for committer > > next Monday. > > I think we have a quorum, so I decided to go ahead and flipped status to RfC. Thanks! I checked this patch. Generally I look good. I've slightly revised that. I think there is one unaddressed concern by Andres Freund [1] about the overhead of this patch by adding extra branches and function calls in the case transaction_timeout is disabled. I tried to measure the overhead of this patch using a pgbench script containing 20 semicolons (20 empty statements in 20 empty transactions). I didn't manage to find measurable overhead or change of performance profile (I used XCode Instruments on my x86 MacBook). One thing, which I still found possible to do is to avoid unconditional calls to get_timeout_active(TRANSACTION_TIMEOUT). Instead I put responsibility for disabling timeout after GUC disables the transaction_timeout assign hook. I removed the TODO comment from _doSetFixedOutputState(). I think backup restore is the operation where slow commands and slow transactions are expected, and it's natural to disable transaction_timeout among other timeouts there. And the existing comment clarifies that. Also I made some grammar fixes to docs and comments. I'm going to push this if there are no objections. Links. 1. https://www.postgresql.org/message-id/20221206011050.s6hapukjqha35hud%40alap3.anarazel.de ------ Regards, Alexander Korotkov
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