Re: [BUG] recovery of prepared transactions during promotion can fail

2023-06-21 Thread Michael Paquier
On Wed, Jun 21, 2023 at 11:11:55AM +0200, Julian Markwort wrote: > I see you've already undone it. > Attached is a patch for 009_twophase.pl to just try this corner case at the > very end, so as not to influence other > existing tests in suite. > > When I run this on REL_14_8 I get the error agai

Re: [BUG] recovery of prepared transactions during promotion can fail

2023-06-21 Thread Julian Markwort
First off, thanks for the quick reaction and reviews, I appreciate it. On Wed, 2023-06-21 at 14:14 +0900, Michael Paquier wrote: > But that won't connect work as the segment requested is now a partial > one in the primary's pg_wal, still the standby wants it. I think since 009_twophase.pl doesn't

Re: [BUG] recovery of prepared transactions during promotion can fail

2023-06-20 Thread Michael Paquier
On Tue, Jun 20, 2023 at 09:33:45PM -0700, Nathan Bossart wrote: > I've started seen sporadic timeouts for 009_twophase.pl in cfbot, and I'm > wondering if it's related to this change. > > https://api.cirrus-ci.com/v1/task/4978271838797824/logs/test_world.log > https://api.cirrus-ci.com

Re: [BUG] recovery of prepared transactions during promotion can fail

2023-06-20 Thread Nathan Bossart
On Tue, Jun 20, 2023 at 10:49:03AM +0900, Michael Paquier wrote: > And done for v13 and v14. I have split the test and comment changes > into their own commit, doing that for v13~HEAD. I've started seen sporadic timeouts for 009_twophase.pl in cfbot, and I'm wondering if it's related to this chan

Re: [BUG] recovery of prepared transactions during promotion can fail

2023-06-19 Thread Michael Paquier
On Mon, Jun 19, 2023 at 04:27:27PM +0900, Michael Paquier wrote: > Okay, cool. Thanks for double-checking, so let's do something down to > 13, then.. And done for v13 and v14. I have split the test and comment changes into their own commit, doing that for v13~HEAD. -- Michael signature.asc Des

Re: [BUG] recovery of prepared transactions during promotion can fail

2023-06-19 Thread Michael Paquier
On Mon, Jun 19, 2023 at 02:41:54PM +0900, Kyotaro Horiguchi wrote: > At Mon, 19 Jun 2023 14:24:44 +0900, Michael Paquier > wrote in >> On Fri, Jun 16, 2023 at 04:27:40PM +0200, Julian Markwort wrote: >>> I've attached patches for PG 14 and PG 13 that mimic the change in >>> PG15 (commit 811051c

Re: [BUG] recovery of prepared transactions during promotion can fail

2023-06-18 Thread Kyotaro Horiguchi
At Mon, 19 Jun 2023 14:24:44 +0900, Michael Paquier wrote in > On Fri, Jun 16, 2023 at 04:27:40PM +0200, Julian Markwort wrote: > > Note that it is important that the PREPARE entry is in the WAL file > > that PostgreSQL is writing to prior to the inital crash. > > This has happened repeatedly in

Re: [BUG] recovery of prepared transactions during promotion can fail

2023-06-18 Thread Kyotaro Horiguchi
Thanks for the report, reproducer and the patches. At Fri, 16 Jun 2023 16:27:40 +0200, Julian Markwort wrote in > - prepare a transaction > - crash postgresql > - create standby.signal file > - start postgresql, wait for recovery to finish > - promote .. > The promotion will fail with a FATAL e

Re: [BUG] recovery of prepared transactions during promotion can fail

2023-06-18 Thread Michael Paquier
On Fri, Jun 16, 2023 at 04:27:40PM +0200, Julian Markwort wrote: > I've discovered a serious bug that leads to a server crash upon > promoting an instance that crashed previously and did recovery in > standby mode. Reproduced here, for the versions mentioned. > The bug is present in PostgreSQL ve