Re: Transaction timeout

2024-03-13 Thread Alexander Korotkov
On Wed, Mar 13, 2024 at 7:56 AM Andrey M. Borodin wrote: > > On 13 Mar 2024, at 05:23, Alexander Korotkov wrote: > > > > On Tue, Mar 12, 2024 at 10:28 AM Andrey M. Borodin > > wrote: > >>> On 11 Mar 2024, at 16:18, Alexander Korotkov wrote: > >>> > >>> I think if checking psql stderr is

Re: Transaction timeout

2024-03-12 Thread Andrey M. Borodin
> On 13 Mar 2024, at 05:23, Alexander Korotkov wrote: > > On Tue, Mar 12, 2024 at 10:28 AM Andrey M. Borodin > wrote: >>> On 11 Mar 2024, at 16:18, Alexander Korotkov wrote: >>> >>> I think if checking psql stderr is problematic, checking just logs is >>> fine. Could we wait for the

Re: Transaction timeout

2024-03-12 Thread Alexander Korotkov
On Tue, Mar 12, 2024 at 10:28 AM Andrey M. Borodin wrote: > > On 11 Mar 2024, at 16:18, Alexander Korotkov wrote: > > > > I think if checking psql stderr is problematic, checking just logs is > > fine. Could we wait for the relevant log messages one by one with > > $node->wait_for_log() just

Re: Transaction timeout

2024-03-12 Thread Andrey M. Borodin
> On 11 Mar 2024, at 16:18, Alexander Korotkov wrote: > > I think if checking psql stderr is problematic, checking just logs is > fine. Could we wait for the relevant log messages one by one with > $node->wait_for_log() just like 040_standby_failover_slots_sync.pl do? PFA version with

Re: Transaction timeout

2024-03-11 Thread Alexander Korotkov
On Mon, Mar 11, 2024 at 12:53 PM Andrey M. Borodin wrote: > > On 7 Mar 2024, at 00:55, Alexander Korotkov wrote: > > > > On Wed, Mar 6, 2024 at 10:22 AM Andrey M. Borodin > > wrote: > >>> On 25 Feb 2024, at 21:50, Alexander Korotkov wrote: > >>> > >>> Thank you for the patches. I've pushed

Re: Transaction timeout

2024-03-11 Thread Andrey M. Borodin
> On 7 Mar 2024, at 00:55, Alexander Korotkov wrote: > > On Wed, Mar 6, 2024 at 10:22 AM Andrey M. Borodin > wrote: >>> On 25 Feb 2024, at 21:50, Alexander Korotkov wrote: >>> >>> Thank you for the patches. I've pushed the 0001 patch to avoid >>> further failures on buildfarm. Let 0004

Re: Transaction timeout

2024-03-06 Thread Alexander Korotkov
On Wed, Mar 6, 2024 at 10:22 AM Andrey M. Borodin wrote: > > On 25 Feb 2024, at 21:50, Alexander Korotkov wrote: > > > > Thank you for the patches. I've pushed the 0001 patch to avoid > > further failures on buildfarm. Let 0004 wait till injections points > > by Mechael are committed. > >

Re: Transaction timeout

2024-03-06 Thread Andrey M. Borodin
> On 25 Feb 2024, at 21:50, Alexander Korotkov wrote: > > Thank you for the patches. I've pushed the 0001 patch to avoid > further failures on buildfarm. Let 0004 wait till injections points > by Mechael are committed. Thanks! All prerequisites are committed. I propose something in a line

Re: Transaction timeout

2024-02-25 Thread Alexander Korotkov
Hi, Andrey! On Thu, Feb 22, 2024 at 7:23 PM Andrey M. Borodin wrote: > > On 19 Feb 2024, at 15:17, Japin Li wrote: > > > > > > +1 > > PFA patch set of 4 patches: > 1. remove all potential flaky tests. BTW recently we had a bingo when 3 of > them failed together [0] > 2-3. waiting injection

Re: Transaction timeout

2024-02-22 Thread Andrey M. Borodin
> On 19 Feb 2024, at 15:17, Japin Li wrote: > > > +1 PFA patch set of 4 patches: 1. remove all potential flaky tests. BTW recently we had a bingo when 3 of them failed together [0] 2-3. waiting injection points patchset by Michael Paquier, intact v2 from nearby thread. 4. prototype of

Re: Transaction timeout

2024-02-19 Thread Japin Li
On Mon, 19 Feb 2024 at 17:14, Andrey M. Borodin wrote: >> On 18 Feb 2024, at 22:16, Andrey M. Borodin wrote: >> >> But it seems a little strange that session 3 did not fail at all > It was only coincidence. Any test that verifies FATALing out in 100ms can > fail, see new failure here [0]. >

Re: Transaction timeout

2024-02-19 Thread Andrey M. Borodin
> On 18 Feb 2024, at 22:16, Andrey M. Borodin wrote: > > But it seems a little strange that session 3 did not fail at all It was only coincidence. Any test that verifies FATALing out in 100ms can fail, see new failure here [0]. In a nearby thread Michael is proposing injections points that

Re: Transaction timeout

2024-02-18 Thread Andrey M. Borodin
sion_timeout vs transaction_timeout(5), and rescheduling transaction_timeout(6). Symptoms: [0] transaction timeout occurs when it is being scheduled. Seems like SET was running to long. step s6_begin: BEGIN ISOLATION LEVEL READ COMMITTED; step s6_tt: SET statement_timeout = '1s'; SET transaction_timeou

Re: Transaction timeout

2024-02-15 Thread Andres Freund
@ -2139,6 +2139,10 @@ StartTransaction(void) >*/ > s->state = TRANS_INPROGRESS; > > + /* Schedule transaction timeout */ > + if (TransactionTimeout > 0) > + enable_timeout_after(TRANSACTION_TIMEOUT, TransactionTimeout); > + > ShowT

Re: Transaction timeout

2024-02-13 Thread Alexander Korotkov
Hi! On Wed, Jan 31, 2024 at 11:57 AM Andrey Borodin wrote: > > On 31 Jan 2024, at 14:27, Japin Li 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

Re: Transaction timeout

2024-01-31 Thread Andrey Borodin
> On 31 Jan 2024, at 14:27, Japin Li 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! Best regards, Andrey Borodin.

Re: Transaction timeout

2024-01-31 Thread Japin Li
On Tue, 30 Jan 2024 at 14:22, Andrey M. Borodin wrote: >> On 26 Jan 2024, at 19:58, Japin Li wrote: >> >> Thanks for updating the patch. Here are some comments for v24. >> >> + >> +Terminate any session that spans longer than the specified amount of >> +time in

Re: Transaction timeout

2024-01-29 Thread Andrey M. Borodin
by two different problems: >> 1. It’s unsafe for isaoltion tester to await transaction_timeout within a >> query. Usually it gets >> FATAL: terminating connection due to transaction timeout >> But if VM is a bit slow it can get occasional >> PQconsumeInput failed: server c

Re: Transaction timeout

2024-01-26 Thread Japin Li
. > I’ve inspected CI fails and they were caused by two different problems: > 1. It’s unsafe for isaoltion tester to await transaction_timeout within a > query. Usually it gets > FATAL: terminating connection due to transaction timeout > But if VM is a bit slow it can get occasi

Re: Transaction timeout

2024-01-25 Thread Andrey M. Borodin
> On 26 Jan 2024, at 11:44, Andrey M. Borodin wrote: > > > 1. It’s unsafe for isaoltion tester to await transaction_timeout within a > query. Usually it gets > FATAL: terminating connection due to transaction timeout > But if VM is a bit slow it can get occasional &g

Re: Transaction timeout

2024-01-25 Thread Andrey M. Borodin
ed CI fails and they were caused by two different problems: 1. It’s unsafe for isaoltion tester to await transaction_timeout within a query. Usually it gets FATAL: terminating connection due to transaction timeout But if VM is a bit slow it can get occasional PQconsumeInput failed: server closed th

Re: Transaction timeout

2024-01-21 Thread Peter Smith
2024-01 Commitfest. Hi, This patch has a CF status of "Needs Review" [1], but it seems there was a CFbot test failure last time it was run [2]. Please have a look and post an updated version if necessary. == [1] https://commitfest.postgresql.org/46/4040/ [2]

Re: Transaction timeout

2024-01-04 Thread Andrey M. Borodin
> On 4 Jan 2024, at 07:14, Japin Li wrote: > > Does the timeout is too short for testing? I see the timeouts for lock_timeout > and statement_timeout is more bigger than transaction_timeout. Makes sense. Done. I've also put some effort into fine-tuning timeouts Nik's case tests. To have

Re: Transaction timeout

2024-01-03 Thread Japin Li
On Wed, 03 Jan 2024 at 20:04, Andrey M. Borodin wrote: >> On 3 Jan 2024, at 16:46, Andrey M. Borodin wrote: >> >> I do not understand why, but mailing list did not pick patches that I sent. >> I'll retry. > > > Sorry for the noise. Seems like Apple updated something in Mail.App couple of >

Re: Transaction timeout

2024-01-03 Thread Andrey M. Borodin
> On 3 Jan 2024, at 16:46, Andrey M. Borodin wrote: > > I do not understand why, but mailing list did not pick patches that I sent. > I'll retry. Sorry for the noise. Seems like Apple updated something in Mail.App couple of days ago and it started to use strange "Apple-Mail" stuff by

Re: Transaction timeout

2024-01-03 Thread Andrey M. Borodin
On 3 Jan 2024, at 11:39, Andrey M. Borodin wrote:On 1 Jan 2024, at 19:28, Andrey M. Borodin wrote: 3. Check that timeout is not rescheduled by new queries (Nik's case)The test of Nik's case was not stable enough together with COMMIT AND CHAIN. So I've

Re: Transaction timeout

2024-01-02 Thread Andrey M. Borodin
On 1 Jan 2024, at 19:28, Andrey M. Borodin wrote: 3. Check that timeout is not rescheduled by new queries (Nik's case)The test of Nik's case was not stable enough together with COMMIT AND CHAIN. So I've separated these cases into different permutations.Looking through CI

Re: Transaction timeout

2024-01-01 Thread Andrey M. Borodin
> On 29 Dec 2023, at 16:15, Andrey M. Borodin wrote: PFA v20. Code steps are intact. Further refactored tests: 1. Check termination of active and idle queries (previously tests from Li were testing only termination of idle query) 2. Check timeout reschedule (even when last active

Re: Transaction timeout

2023-12-29 Thread Andrey M. Borodin
> On 29 Dec 2023, at 16:00, Junwang Zhao wrote: > > After exploring the code, I found scheduling the timeout in > `StartTransaction` might be a reasonable idea, all the chain > commands will call this function. > > What concerns me is that it is also called by StartParallelWorkerTransaction,

Re: Transaction timeout

2023-12-29 Thread Junwang Zhao
On Fri, Dec 29, 2023 at 6:00 PM Andrey M. Borodin wrote: > > > > > On 28 Dec 2023, at 21:02, Junwang Zhao wrote: > > > > Seems V5~V17 doesn't work as expected for Nikolay's case: > > > > Yeah, that's a problem. > > So I propose the following change, what do you think? > This breaks COMMIT AND

Re: Transaction timeout

2023-12-29 Thread Andrey M. Borodin
> On 28 Dec 2023, at 21:02, Junwang Zhao wrote: > > Seems V5~V17 doesn't work as expected for Nikolay's case: > Yeah, that's a problem. > So I propose the following change, what do you think? This breaks COMMIT AND CHAIN. PFA v18: I've added a test for Nik's case and for COMMIT AND CHAIN.

Re: Transaction timeout

2023-12-28 Thread Junwang Zhao
Hey Andrey, On Sun, Dec 24, 2023 at 1:14 AM Andrey M. Borodin wrote: > > > > > On 22 Dec 2023, at 10:39, Japin Li wrote: > > > > > > I try to split the test for transaction timeout, and all passed on my CI > > [1]. > > > I like th

Re: Transaction timeout

2023-12-24 Thread Japin Li
On Sun, 24 Dec 2023 at 01:14, Andrey M. Borodin wrote: >> On 22 Dec 2023, at 10:39, Japin Li wrote: >> >> >> I try to split the test for transaction timeout, and all passed on my CI [1]. > > > I like the refactoring you did in timeout.spec. I thought it is im

Re: Transaction timeout

2023-12-24 Thread Junwang Zhao
Hi Andrey, On Sun, Dec 24, 2023 at 1:14 AM Andrey M. Borodin wrote: > > > > > On 22 Dec 2023, at 10:39, Japin Li wrote: > > > > > > I try to split the test for transaction timeout, and all passed on my CI > > [1]. > > > I like the refactoring you

Re: Transaction timeout

2023-12-23 Thread Andrey M. Borodin
> On 22 Dec 2023, at 10:39, Japin Li wrote: > > > I try to split the test for transaction timeout, and all passed on my CI [1]. I like the refactoring you did in timeout.spec. I thought it is impossible, because permutations would try to reinitialize FATALed sessions. But

Re: Transaction timeout

2023-12-22 Thread Li Japin
> 在 2023年12月23日,11:35,Junwang Zhao 写道: > > On Sat, Dec 23, 2023 at 11:17 AM Japin Li wrote: >> >> a >>> On Sat, 23 Dec 2023 at 10:40, Japin Li wrote: >>> On Sat, 23 Dec 2023 at 08:32, Japin Li wrote: On Fri, 22 Dec 2023 at 23:30, Junwang Zhao wrote: > On Fri, Dec 22, 2023 at

Re: Transaction timeout

2023-12-22 Thread Junwang Zhao
On Sat, Dec 23, 2023 at 11:17 AM Japin Li wrote: > > a > On Sat, 23 Dec 2023 at 10:40, Japin Li wrote: > > On Sat, 23 Dec 2023 at 08:32, Japin Li wrote: > >> On Fri, 22 Dec 2023 at 23:30, Junwang Zhao wrote: > >>> On Fri, Dec 22, 2023 at 10:44 PM Japin Li wrote: > > > On Fri,

Re: Transaction timeout

2023-12-22 Thread Japin Li
x b6451d9d08..4be06c1e5d 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -59,6 +59,7 @@ int DeadlockTimeout = 1000; int StatementTimeout = 0; int LockTimeout = 0; int IdleInTransactionSessionTimeout = 0; +int TransactionTimeout = 0; int I

Re: Transaction timeout

2023-12-22 Thread Junwang Zhao
On Sat, Dec 23, 2023 at 10:40 AM Japin Li wrote: > > > On Sat, 23 Dec 2023 at 08:32, Japin Li wrote: > > On Fri, 22 Dec 2023 at 23:30, Junwang Zhao wrote: > >> On Fri, Dec 22, 2023 at 10:44 PM Japin Li wrote: > >>> > >>> > >>> On Fri, 22 Dec 2023 at 22:37, Junwang Zhao wrote: > >>> > On Fri,

Re: Transaction timeout

2023-12-22 Thread Japin Li
On Sat, 23 Dec 2023 at 08:32, Japin Li wrote: > On Fri, 22 Dec 2023 at 23:30, Junwang Zhao wrote: >> On Fri, Dec 22, 2023 at 10:44 PM Japin Li wrote: >>> >>> >>> On Fri, 22 Dec 2023 at 22:37, Junwang Zhao wrote: >>> > On Fri, Dec 22, 2023 at 10:25 PM Japin Li wrote: >>> >> I try to set

Re: Transaction timeout

2023-12-22 Thread Japin Li
On Fri, 22 Dec 2023 at 23:30, Junwang Zhao wrote: > On Fri, Dec 22, 2023 at 10:44 PM Japin Li wrote: >> >> >> On Fri, 22 Dec 2023 at 22:37, Junwang Zhao wrote: >> > On Fri, Dec 22, 2023 at 10:25 PM Japin Li wrote: >> >> I try to set idle_in_transaction_session_timeout after begin

Re: Transaction timeout

2023-12-22 Thread Junwang Zhao
On Fri, Dec 22, 2023 at 10:44 PM Japin Li wrote: > > > On Fri, 22 Dec 2023 at 22:37, Junwang Zhao wrote: > > On Fri, Dec 22, 2023 at 10:25 PM Japin Li wrote: > >> I try to set idle_in_transaction_session_timeout after begin transaction, > >> it changes immediately, so I think

Re: Transaction timeout

2023-12-22 Thread Japin Li
On Fri, 22 Dec 2023 at 22:37, Junwang Zhao wrote: > On Fri, Dec 22, 2023 at 10:25 PM Japin Li 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,

Re: Transaction timeout

2023-12-22 Thread Junwang Zhao
gt; count > >> > - > >> > -0 > >> > +1 > >> > (1 row) > >> > > >> > step itt4_set: SET idle_in_transaction_session_timeout = '1ms'; SET > >> > statement_timeout = '10s'; SET lock_timeout = '10s'; S

Re: Transaction timeout

2023-12-22 Thread Japin Li
FROM pg_stat_activity WHERE >> > application_name = 'isolation/timeouts/stt2' >> > count >> > - >> > -0 >> > +1 >> > (1 row) >> > >> > step itt4_set: SET idle_in_transaction_session_timeout = '1ms'; SET >> > statement_

Re: Transaction timeout

2023-12-22 Thread Junwang Zhao
; > (1 row) > > > > step itt4_set: SET idle_in_transaction_session_timeout = '1ms'; SET > > statement_timeout = '10s'; SET lock_timeout = '10s'; SET > > transaction_timeout = '10s'; > > > > [1] > > https://api.cirrus-ci.com/v1/artifact/task/4707530400595968/t

Re: Transaction timeout

2023-12-21 Thread Japin Li
gt; > [1] > https://api.cirrus-ci.com/v1/artifact/task/4707530400595968/testrun/build/testrun/isolation/isolation/regression.diffs Hi, I try to split the test for transaction timeout, and all passed on my CI [1]. OTOH, I find if I set transaction_timeout in a transaction, it will not take effect

Re: Transaction timeout

2023-12-20 Thread wenhui qiu
t; > michael.paqu...@gmail.com>; Nikolay Samokhvalov ; > pgsql-hackers ; > pgsql-hackers@lists.postgresql.org > > 主题: Re: Transaction timeout > > > > On Tue, Dec 19, 2023 at 10:51 PM Junwang Zhao wrote: > > > > > > On Tue, Dec 19, 2023 at 6:27 PM Andrey

Re: Transaction timeout

2023-12-19 Thread Junwang Zhao
drey M. Borodin > 抄送: Japin Li ; 邱宇航 ; Fujii Masao > ; Andrey Borodin ; Andres > Freund ; Michael Paquier ; > Nikolay Samokhvalov ; pgsql-hackers > ; pgsql-hackers@lists.postgresql.org > > 主题: Re: Transaction timeout > > On Tue, Dec 19, 2023 at 10:51 PM Junwan

回复: Transaction timeout

2023-12-19 Thread Thomas wen
: Andrey M. Borodin 抄送: Japin Li ; 邱宇航 ; Fujii Masao ; Andrey Borodin ; Andres Freund ; Michael Paquier ; Nikolay Samokhvalov ; pgsql-hackers ; pgsql-hackers@lists.postgresql.org 主题: Re: Transaction timeout On Tue, Dec 19, 2023 at 10:51 PM Junwang Zhao wrote: > > On Tue, Dec 19, 2023 at 6

Re: Transaction timeout

2023-12-19 Thread Junwang Zhao
On Tue, Dec 19, 2023 at 10:51 PM Junwang Zhao wrote: > > On Tue, Dec 19, 2023 at 6:27 PM Andrey M. Borodin > wrote: > > > > > > > > > On 19 Dec 2023, at 13:26, Andrey M. Borodin wrote: > > > > > > I don’t have Windows machine, so I hope CF bot will pick this. > > > > I used Github CI to

Re: Transaction timeout

2023-12-19 Thread Junwang Zhao
On Tue, Dec 19, 2023 at 6:27 PM Andrey M. Borodin wrote: > > > > > On 19 Dec 2023, at 13:26, Andrey M. Borodin wrote: > > > > I don’t have Windows machine, so I hope CF bot will pick this. > > I used Github CI to produce version of tests that seems to be is stable on > Windows. > Sorry for the

Re: Transaction timeout

2023-12-19 Thread Japin Li
On Tue, 19 Dec 2023 at 18:27, Andrey M. Borodin wrote: >> On 19 Dec 2023, at 13:26, Andrey M. Borodin wrote: >> >> I don’t have Windows machine, so I hope CF bot will pick this. > > I used Github CI to produce version of tests that seems to be is stable on > Windows. It still failed on

Re: Transaction timeout

2023-12-19 Thread Andrey M. Borodin
> On 19 Dec 2023, at 13:26, Andrey M. Borodin wrote: > > I don’t have Windows machine, so I hope CF bot will pick this. I used Github CI to produce version of tests that seems to be is stable on Windows. Sorry for the noise. Best regards, Andrey Borodin.

Re: Transaction timeout

2023-12-19 Thread Andrey M. Borodin
> On 19 Dec 2023, at 06:25, Japin Li wrote: > > On Windows, there still have an error: Uhhmm, yes. Connection termination looks different on windows machine. I’ve checked how this looks in relication slot tests and removed select that was observing connection failure. I don’t have Windows

Re: Transaction timeout

2023-12-18 Thread Japin Li
/results/timeouts.out 2023-12-18 10:26:08.039831800 + @@ -103,24 +103,7 @@ 0 (1 row) -step stt2_check: SELECT 1; -FATAL: terminating connection due to transaction timeout -server closed the connection unexpectedly +PQconsumeInput failed: server closed the connection unexpectedly

Re: Transaction timeout

2023-12-18 Thread Andrey M. Borodin
> On 18 Dec 2023, at 14:32, Japin Li wrote: > > > Thanks for updating the patch Sorry for the noise, but commitfest bot found one more bug in handling statement timeout. PFA v11. Best regards, Andrey Borodin. v11-0001-Introduce-transaction_timeout.patch Description: Binary data

Re: Transaction timeout

2023-12-18 Thread Japin Li
On Mon, 18 Dec 2023 at 13:49, Andrey M. Borodin wrote: >> On 16 Dec 2023, at 05:58, Japin Li wrote: >> >> >> On Fri, 15 Dec 2023 at 17:51, Andrey M. Borodin wrote: On 8 Dec 2023, at 15:29, Japin Li wrote: Thanks for updating the patch. LGTM. >>> >>> PFA v9. Changes: >>> 1.

Re: Transaction timeout

2023-12-17 Thread Andrey M. Borodin
> On 16 Dec 2023, at 05:58, Japin Li wrote: > > > On Fri, 15 Dec 2023 at 17:51, Andrey M. Borodin wrote: >>> On 8 Dec 2023, at 15:29, Japin Li wrote: >>> >>> Thanks for updating the patch. LGTM. >> >> PFA v9. Changes: >> 1. Added tests for idle_in_transaction_timeout >> 2. Suppress

Re: Transaction timeout

2023-12-15 Thread Japin Li
On Fri, 15 Dec 2023 at 17:51, Andrey M. Borodin wrote: >> On 8 Dec 2023, at 15:29, Japin Li wrote: >> >> Thanks for updating the patch. LGTM. > > PFA v9. Changes: > 1. Added tests for idle_in_transaction_timeout > 2. Suppress statement_timeout if it’s shorter than transaction_timeout > +

Re: Transaction timeout

2023-12-15 Thread Andrey M. Borodin
> On 8 Dec 2023, at 15:29, Japin Li wrote: > > Thanks for updating the patch. LGTM. PFA v9. Changes: 1. Added tests for idle_in_transaction_timeout 2. Suppress statement_timeout if it’s shorter than transaction_timeout Consider changing status of the commitfest entry if you think it’s ready

Re: Transaction timeout

2023-12-08 Thread Japin Li
le_in_transaction_timeout is bigger than transaction_timeout, >>>> the idle-in-transaction timeout don't needed, right? >>> Yes, I think so. >>> >> >> Should we disable the idle_in_transaction_timeout in this case? Of cursor, >> I'm >>

Re: Transaction timeout

2023-12-08 Thread Andrey M. Borodin
> On 8 Dec 2023, at 12:59, Japin Li wrote: > > > On Thu, 07 Dec 2023 at 20:40, Andrey M. Borodin wrote: >>> On 7 Dec 2023, at 06:25, Japin Li wrote: >>> >>> If idle_in_transaction_timeout is bigger than transaction_timeout, >>> the idle-in-tr

Re: Transaction timeout

2023-12-08 Thread Japin Li
On Thu, 07 Dec 2023 at 20:40, Andrey M. Borodin wrote: >> On 7 Dec 2023, at 06:25, Japin Li wrote: >> >> If idle_in_transaction_timeout is bigger than transaction_timeout, >> the idle-in-transaction timeout don't needed, right? > Yes, I thi

Re: Transaction timeout

2023-12-07 Thread Andrey M. Borodin
> On 7 Dec 2023, at 06:25, Japin Li wrote: > > If idle_in_transaction_timeout is bigger than transaction_timeout, > the idle-in-transaction timeout don't needed, right? Yes, I think so. > >> TODO: as Yuhang pointed out prepared transactions must not be

Re: Transaction timeout

2023-12-07 Thread Andrey M. Borodin
Thanks Yuhang!On 7 Dec 2023, at 13:39, 邱宇航 wrote:I read the V6 patch and found something needs to be improved.Fixed. PFA v7.Best regards, Andrey Borodin. v7-0001-Introduce-transaction_timeout.patch Description: Binary data

Re: Transaction timeout

2023-12-07 Thread 邱宇航
Hi, I read the V6 patch and found something needs to be improved. Prepared transactions should also be documented. A value of zero (the default) disables the timeout. +This timeout is not applied to prepared transactions. Only transactions +with user connections are

Re: Transaction timeout

2023-12-06 Thread Japin Li
transactions > 3. New isolation tests are slightly more complex: isolation tester does not > like when the connection is forcibly killed, thus there must be only 1 > permutation with killed connection. > Greate. If idle_in_transaction_timeout is bigger than transaction_timeout, the idl

Re: Transaction timeout

2023-12-06 Thread Andrey M. Borodin
> On 30 Nov 2023, at 20:06, Andrey M. Borodin wrote: > > > Tomorrow I plan to fix raising of the timeout when the transaction is idle. > Renaming transaction_timeout to something else (to avoid confusion with > prepared xacts) also seems correct to me. Here's a v6 version of the feature.

Re: Transaction timeout

2023-11-30 Thread Andrey M. Borodin
> On 20 Nov 2023, at 06:33, 邱宇航 wrote: Nikolay, Peter, Fujii, Tung, Yuhang, thank you for reviewing this. I'll address feedback soon, this patch has been for a long time on my TODO list. I've started with fixing problem of COMMIT AND CHAIN by restarting timeout counter. Tomorrow I plan to fix

Re: Transaction timeout

2023-11-19 Thread 邱宇航
I test the V4 patch and found the backend does't process SIGINT while it's in secure_read. And it seems not a good choice to report ERROR during secure_read, which will turns into FATAL "terminating connection because protocol synchronization was lost". It might be much easier to terminate

Re: Transaction timeout

2023-10-10 Thread Nikolay Samokhvalov
ght 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. I agree – it seems reasonable to interrupt transaction immediately when the timeou

Re: Transaction timeout

2023-09-07 Thread bt23nguyent
On 2023-09-06 20:32, Andrey M. Borodin wrote: Thanks for looking into this! On 6 Sep 2023, at 13:16, Fujii Masao 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

Re: Transaction timeout

2023-09-06 Thread Andrey M. Borodin
Thanks for looking into this! > On 6 Sep 2023, at 13:16, Fujii Masao 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 >

Re: Transaction timeout

2023-09-06 Thread Fujii Masao
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? With the v4 patch, I found that timeout errors no longer occur

Re: Transaction timeout

2023-09-01 Thread Peter Eisentraut
On 12.01.23 20:46, Andrey Borodin wrote: On Sun, Dec 18, 2022 at 12:53:31PM -0800, Andrey Borodin wrote: I've rewritten this part to correctly report all timeouts that did happen. However there's now a tricky comma-formatting code which was tested only manually. I suspect this will make

Re: Transaction timeout

2023-01-13 Thread Nikolay Samokhvalov
On Fri, Jan 13, 2023 at 10:16 AM Andrey Borodin wrote: > > – 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(),

Re: Transaction timeout

2023-01-13 Thread Andrey Borodin
Thanks for the review Nikolay! On Fri, Jan 13, 2023 at 8:03 AM Nikolay Samokhvalov 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

Re: Transaction timeout

2023-01-13 Thread Nikolay Samokhvalov
on_timeout to '20ms'; SET gitpod=# begin; select pg_sleep(.01); select pg_sleep(.01); select pg_sleep(.01); commit; BEGIN pg_sleep -- (1 row) ERROR: canceling statement due to transaction timeout gitpod=# set statement_timeout to '20ms'; set transaction_timeout to 0; -- to test value for st

Re: Transaction timeout

2023-01-12 Thread Andrey Borodin
On Thu, Jan 12, 2023 at 11:24 AM Nathan Bossart wrote: > > On Sun, Dec 18, 2022 at 12:53:31PM -0800, Andrey Borodin wrote: > > I've rewritten this part to correctly report all timeouts that did > > happen. However there's now a tricky comma-formatting code which was > > tested only manually. > >

Re: Transaction timeout

2023-01-12 Thread Nathan Bossart
On Sun, Dec 18, 2022 at 12:53:31PM -0800, Andrey Borodin wrote: > I've rewritten this part to correctly report all timeouts that did > happen. However there's now a tricky comma-formatting code which was > tested only manually. I suspect this will make translation difficult. >> > > > +

Re: Transaction timeout

2022-12-18 Thread Andrey Borodin
not change anything in pg_backup_archiver.c. > > Either way we can do batch function enable_timeouts() instead > > enable_timeout_after(). > > > Does anything of it make sense? > > I'm at least as worried about the various calls *after* the execution of > a statement. I think this code is just a one b

Re: Transaction timeout

2022-12-07 Thread Andrey Borodin
On Wed, Dec 7, 2022 at 10:23 AM Andres Freund wrote: > > On 2022-12-03 09:41:04 -0800, Andrey Borodin wrote: > > Fixed. Added test for this. > > The tests don't pass: https://cirrus-ci.com/build/4811553145356288 > oops, sorry. Here's the fix. I hope to address other feedback on the weekend. Thank

Re: Transaction timeout

2022-12-07 Thread Andres Freund
Hi, On 2022-12-03 09:41:04 -0800, Andrey Borodin wrote: > Fixed. Added test for this. The tests don't pass: https://cirrus-ci.com/build/4811553145356288 [00:54:35.337](1.251s) not ok 1 - no parameters missing from postgresql.conf.sample [00:54:35.338](0.000s) # Failed test 'no parameters

Re: Transaction timeout

2022-12-06 Thread Kyotaro Horiguchi
At Mon, 5 Dec 2022 17:10:50 -0800, Andres Freund wrote in > I'm most concerned about the overhead when the timeouts are *not* > enabled. And this adds a branch to start_xact_command() and a function > call for get_timeout_active(TRANSACTION_TIMEOUT) in that case. On its > own, that's not a whole

Re: Transaction timeout

2022-12-05 Thread Andres Freund
Hi, On 2022-12-06 09:44:01 +0900, Kyotaro Horiguchi wrote: > At Mon, 5 Dec 2022 15:07:47 -0800, Andres Freund wrote in > > I'm a bit worried about adding evermore branches and function calls for > > the processing of single statements. We already spend a noticable > > percentage of the cycles

Re: Transaction timeout

2022-12-05 Thread Kyotaro Horiguchi
At Mon, 5 Dec 2022 15:07:47 -0800, Andres Freund wrote in > I'm a bit worried about adding evermore branches and function calls for > the processing of single statements. We already spend a noticable > percentage of the cycles for a single statement in PostgresMain(), this > adds additional

Re: Transaction timeout

2022-12-05 Thread Andres Freund
e for e.g. idle_in_transaction_session_timeout, because I think e.g. parallel backup can lead to a connection being idle for a bit. A few more review comments: > Either way we can do batch function enable_timeouts() instead > enable_timeout_after(). > Does anything of it make sense? I'm at least as worried abou

Re: Transaction timeout

2022-12-05 Thread Andrey Borodin
Thanks for looking into this Andres! On Mon, Dec 5, 2022 at 3:07 PM Andres Freund wrote: > > I'm a bit worried about adding evermore branches and function calls for > the processing of single statements. We already spend a noticable > percentage of the cycles for a single statement in

Re: Transaction timeout

2022-12-05 Thread Andres Freund
eep(0.0001) } > +step sleep10 { SELECT pg_sleep(0.01) } > step locktbl { LOCK TABLE accounts; } > step update { DELETE FROM accounts WHERE accountid = 'checking'; } > teardown { ABORT; } > @@ -47,3 +50,5 @@ permutation wrtbl lto update(*) > permutation wrtbl lsto update(*) > #

Re: Transaction timeout

2022-12-05 Thread Nikolay Samokhvalov
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: not tested Documentation:not tested Tested, works as expected; documentation is not yet added

Re: Transaction timeout

2022-12-05 Thread Nikolay Samokhvalov
On Sat, Dec 3, 2022 at 9:41 AM Andrey Borodin wrote: > Fixed. Added test for this. > Thanks! Tested (gitpod: https://gitpod.io/#https://gitlab.com/NikolayS/postgres/tree/transaction_timeout-v2 ), works as expected.

Re: Transaction timeout

2022-12-03 Thread Andrey Borodin
On Fri, Dec 2, 2022 at 10:59 PM Nikolay Samokhvalov wrote: > > But it fails in the "worst" case I've described above – a series of small > statements: Fixed. Added test for this. Open questions: 1. Docs 2. Order of reporting if happened lock_timeout, statement_timeout, and transaction_timeout

Re: Transaction timeout

2022-12-02 Thread Nikolay Samokhvalov
ion_timeout to '2s'; SET postgres=# select pg_sleep(3); ERROR: canceling transaction due to transaction timeout But it fails in the "worst" case I've described above – a series of small statements: postgres=# set transaction_timeout to '2s'; SET postgres=# begin; select pg_sleep(1); sel

Transaction timeout

2022-12-02 Thread Andrey Borodin
Hello, We have statement_timeout, idle_in_transaction_timeout, idle_session_timeout and many more! But we have no transaction_timeout. I've skimmed thread [0,1] about existing timeouts and found no contraindications to implement transaction_timeout. Nikolay asked me if I can prototype the

Re: idle-in-transaction timeout error does not give a hint

2019-03-31 Thread Tatsuo Ishii
st retrying. >>> This is different from some of the other cases that were cited, such >>> as serialization conflicts, where you just got unlucky due to >>> concurrent events. In the case of idle-in-transaction-timeout, the >>> fault is entirely your own. >&g

RE: idle-in-transaction timeout error does not give a hint

2019-03-31 Thread Ideriha, Takeshi
t; This is different from some of the other cases that were cited, such >> as serialization conflicts, where you just got unlucky due to >> concurrent events. In the case of idle-in-transaction-timeout, the >> fault is entirely your own. > >Hum. Sounds like a fair argument. Ide

Re: idle-in-transaction timeout error does not give a hint

2019-03-29 Thread Tatsuo Ishii
t were cited, such as > serialization conflicts, where you just got unlucky due to concurrent > events. In the case of idle-in-transaction-timeout, the fault is > entirely your own. Hum. Sounds like a fair argument. Ideriha-san, what do you think? Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: ht

Re: idle-in-transaction timeout error does not give a hint

2019-03-28 Thread Peter Eisentraut
On 2018-11-28 04:17, Tatsuo Ishii wrote: > + errmsg("terminating connection due to > idle-in-transaction timeout"), > + errhint("In a moment you should

RE: idle-in-transaction timeout error does not give a hint

2019-02-14 Thread Jamison, Kirk
base and restart your transaction. I think this error hint message makes sense for idle-in-transaction timeout. It's grammatically correct and gives a clearer hint for that. I agree that "reconnect to database" implies "restart session", so it may not be the best word for er

  1   2   >