Re: Transaction timeout
Japin Li <japinli@hotmail.com>
From: Japin Li <japinli@hotmail.com>
To: "Andrey M. Borodin" <x4mmm@yandex-team.ru>
Cc: Peter Smith <smithpb2250@gmail.com>, Junwang Zhao <zhjwpku@gmail.com>, 邱宇航 <iamqyh@gmail.com>, Fujii Masao <masao.fujii@oss.nttdata.com>, Andrey Borodin <amborodin86@gmail.com>, Andres Freund <andres@anarazel.de>, Michael Paquier <michael.paquier@gmail.com>, Nikolay Samokhvalov <samokhvalov@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2024-01-31T09:27:06Z
Lists: pgsql-hackers
On Tue, 30 Jan 2024 at 14:22, Andrey M. Borodin <x4mmm@yandex-team.ru> wrote: >> On 26 Jan 2024, at 19:58, Japin Li <japinli@hotmail.com> wrote: >> >> Thanks for updating the patch. Here are some comments for v24. >> >> + <para> >> + Terminate any session that spans longer than the specified amount of >> + time in transaction. The limit applies both to explicit transactions >> + (started with <command>BEGIN</command>) and to implicitly started >> + transaction corresponding to single statement. But this limit is not >> + applied to prepared transactions. >> + If this value is specified without units, it is taken as milliseconds. >> + A value of zero (the default) disables the timeout. >> + </para> >> The sentence "But this limit is not applied to prepared transactions" is redundant, >> since we have a paragraph to describe this later. > Fixed. >> >> + >> + <para> >> + If <varname>transaction_timeout</varname> is shorter than >> + <varname>idle_in_transaction_session_timeout</varname> or <varname>statement_timeout</varname> >> + <varname>transaction_timeout</varname> will invalidate longer timeout. >> + </para> >> + >> >> Since we are already try to disable the timeouts, should we try to disable >> them even if they are equal. > > Well, we disable timeouts on equality. Fixed docs. > >> >> + >> + <para> >> + Prepared transactions are not subject for this timeout. >> + </para> >> >> Maybe wrap this with <note> is a good idea. > Done. > Thanks for updating the patch. LGTM. If there is no other objections, I'll change it to ready for committer next Monday.
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