public inbox for [email protected]  
help / color / mirror / Atom feed
From: Japin Li <[email protected]>
To: Japin Li <[email protected]>
Cc: Junwang Zhao <[email protected]>
Cc: Andrey M. Borodin <[email protected]>
Cc: 邱宇航 <[email protected]>
Cc: Fujii Masao <[email protected]>
Cc: Andrey Borodin <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: Michael Paquier <[email protected]>
Cc: Nikolay Samokhvalov <[email protected]>
Cc: pgsql-hackers <[email protected]>
Cc: [email protected]
Subject: Re: Transaction timeout
Date: Sat, 23 Dec 2023 10:40:32 +0800
Message-ID: <ME3P282MB31663557EEF80E7CA97FBC32B69BA@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <ME3P282MB3166AB8DF0381F27C077AF70B69BA@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM>
References: <CAAhFRxiQsRs2Eq5kCo9nXE3HTugsAAJdSQSmxncivebAxdmBjQ@mail.gmail.com>
	<[email protected]>
	<SY8PR01MB9288F5CF03D38662BE59C628B68AA@SY8PR01MB9288.ausprd01.prod.outlook.com>
	<[email protected]>
	<SY8PR01MB9288335A3B81E8D6E121980FB68AA@SY8PR01MB9288.ausprd01.prod.outlook.com>
	<[email protected]>
	<ME3P282MB3166E33F193D2E7B0CDB633FB692A@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM>
	<[email protected]>
	<MEYP282MB316457B6810B840A012649AFB690A@MEYP282MB3164.AUSP282.PROD.OUTLOOK.COM>
	<[email protected]>
	<ME3P282MB316699E4C3A165983731076EB697A@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM>
	<[email protected]>
	<[email protected]>
	<ME3P282MB316662848DEF947EE0B4B091B697A@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM>
	<ME3P282MB3166FCD27CCC06C8E94134B5B694A@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM>
	<CAEG8a3J4DY1VaSd-GHkN8VHXV0vGkO83-Y50OUyac+jObmFW+g@mail.gmail.com>
	<ME3P282MB316662CE6ED67FB49C930BC9B694A@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM>
	<CAEG8a3JAStzhgPpEL4KvhJz7+s_S2-39h1PRe6+WdWW7=xcOFA@mail.gmail.com>
	<ME3P282MB31665F69A72FE8427EE8C49FB694A@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM>
	<CAEG8a3K8kD0mQDFzj=v0zV7h+m4J4TDBLkXSJJS3+VGWNvnDCQ@mail.gmail.com>
	<ME3P282MB3166AB8DF0381F27C077AF70B69BA@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM>


On Sat, 23 Dec 2023 at 08:32, Japin Li <[email protected]> wrote:
> On Fri, 22 Dec 2023 at 23:30, Junwang Zhao <[email protected]> wrote:
>> On Fri, Dec 22, 2023 at 10:44 PM Japin Li <[email protected]> wrote:
>>>
>>>
>>> On Fri, 22 Dec 2023 at 22:37, Junwang Zhao <[email protected]> wrote:
>>> > On Fri, Dec 22, 2023 at 10:25 PM Japin Li <[email protected]> wrote:
>>> >> I try to set idle_in_transaction_session_timeout after begin transaction,
>>> >> it changes immediately, so I think transaction_timeout should also be take
>>> >> immediately.
>>> >
>>> > Ah, right, idle_in_transaction_session_timeout is set after the set
>>> > command finishes and before the backend send *ready for query*
>>> > to the client, so the value of the GUC is already set before
>>> > next command.
>>> >
>>>
>>> I mean, is it possible to set transaction_timeout before next comand?
>>>
>> Yeah, it's possible, set transaction_timeout in the when it first
>> goes into *idle in transaction* mode, see the attached files.
>>
>
> Thanks for updating the patch, LGTM.

Sorry for the noise!

Read the previous threads, I find why the author enable transaction_timeout
in start_xact_command().

The v15 patch cannot handle COMMIT AND CHAIN, see [1]. For example:

SET transaction_timeout TO '2s'; BEGIN; SELECT 1, pg_sleep(1); COMMIT AND CHAIN; SELECT 2, pg_sleep(1); COMMIT;

The transaction_timeout do not reset when executing COMMIT AND CHAIN.

[1] https://www.postgresql.org/message-id/a906dea1-76a1-4f26-76c5-a7efad3ef5b8%40oss.nttdata.com

--
Regrads,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.






view thread (61+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Transaction timeout
  In-Reply-To: <ME3P282MB31663557EEF80E7CA97FBC32B69BA@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox