Re: Transaction timeout

From: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Andrey Borodin <amborodin86(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Transaction timeout
Date: 2023-09-06 11:32:33
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Thanks for looking into this!

> On 6 Sep 2023, at 13:16, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
> While testing v4 patch, I noticed it doesn't handle the COMMIT AND CHAIN case correctly.
> When COMMIT AND CHAIN is executed, I believe the transaction timeout counter should reset
> and start from zero with the next transaction. However, it appears that the current
> v4 patch doesn't reset the counter in this scenario. Can you confirm this?
Yes, I was not aware of this feature. I'll test and fix this.

> With the v4 patch, I found that timeout errors no longer occur during the idle in
> transaction phase. Instead, they occur when the next statement is executed. Is this
> the intended behavior?
AFAIR I had been testing that behaviour of "idle in transaction" was intact. I'll check that again.

> I thought some users might want to use the transaction timeout
> feature to prevent prolonged transactions and promptly release resources (e.g., locks)
> in case of a timeout, similar to idle_in_transaction_session_timeout.
Yes, this is exactly how I was expecting the feature to behave: empty up max_connections slots for long-hanging transactions.

Thanks for your findings, I'll check and post new version!

Best regards, Andrey Borodin.

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message jacktby jacktby 2023-09-06 11:46:42 Re: How to add a new pg oid?
Previous Message Yugo NAGATA 2023-09-06 11:13:34 Re: pgbnech: allow to cancel queries during benchmark