Re: BUG #15346: Replica fails to start after the crash

2018-08-31 Thread Michael Paquier
On Thu, Aug 30, 2018 at 11:23:54PM -0700, Michael Paquier wrote: > Yes that's a matter of safety, as I put into the truck any modules which > may use XLogFlush(). And that maps with the old code, so there is no > more surprise. Okay, I have pushed my previous version as that's the safest approach

Re: BUG #15346: Replica fails to start after the crash

2018-08-30 Thread Michael Paquier
On Fri, Aug 31, 2018 at 02:52:06PM +0900, Kyotaro HORIGUCHI wrote: > The patch inhibits turning off updateMinRecoveryPoint on other > than the startup process running crash-recovery except at the end > of XLogNeedsFlush. Yes that's a matter of safety, as I put into the truck any modules which may

Re: BUG #15346: Replica fails to start after the crash

2018-08-30 Thread Kyotaro HORIGUCHI
At Thu, 30 Aug 2018 18:48:55 -0700, Michael Paquier wrote in <20180831014855.gj15...@paquier.xyz> > On Fri, Aug 31, 2018 at 09:48:46AM +0900, Kyotaro HORIGUCHI wrote: > > Please wait a bit.. I have a concern about this. > > Sure, please feel free. Thanks. I looked though the patch and related

Re: BUG #15346: Replica fails to start after the crash

2018-08-30 Thread Michael Paquier
On Fri, Aug 31, 2018 at 09:48:46AM +0900, Kyotaro HORIGUCHI wrote: > Please wait a bit.. I have a concern about this. Sure, please feel free. -- Michael signature.asc Description: PGP signature

Re: BUG #15346: Replica fails to start after the crash

2018-08-30 Thread Kyotaro HORIGUCHI
At Thu, 30 Aug 2018 11:57:05 -0700, Michael Paquier wrote in <20180830185705.gf15...@paquier.xyz> > On Thu, Aug 30, 2018 at 08:31:36PM +0200, Alexander Kukushkin wrote: > > 2018-08-30 19:34 GMT+02:00 Michael Paquier : > >> I have been struggling for a couple of hours to get a deterministic test >

Re: BUG #15346: Replica fails to start after the crash

2018-08-30 Thread Michael Paquier
On Thu, Aug 30, 2018 at 08:31:36PM +0200, Alexander Kukushkin wrote: > 2018-08-30 19:34 GMT+02:00 Michael Paquier : >> I have been struggling for a couple of hours to get a deterministic test >> case out of my pocket, and I did not get one as you would need to get >> the bgwriter to flush a page be

Re: BUG #15346: Replica fails to start after the crash

2018-08-30 Thread Alexander Kukushkin
2018-08-30 19:34 GMT+02:00 Michael Paquier : > I have been struggling for a couple of hours to get a deterministic test > case out of my pocket, and I did not get one as you would need to get > the bgwriter to flush a page before crash recovery finishes, we could do In my case the active standby s

Re: BUG #15346: Replica fails to start after the crash

2018-08-30 Thread Michael Paquier
On Thu, Aug 30, 2018 at 04:03:43PM +0200, Alexander Kukushkin wrote: > 2018-08-30 15:39 GMT+02:00 Michael Paquier : >> Does it take care of the problem? > > Yep, with the patch applied bgwriter acts as expected! Thanks for double-checking. I have been struggling for a couple of hours to get a de

Re: BUG #15346: Replica fails to start after the crash

2018-08-30 Thread Alexander Kukushkin
Hi, 2018-08-30 15:39 GMT+02:00 Michael Paquier : > That's indeed obvious by reading the code. The bgwriter would be > started only once a consistent point has been reached, so the startup > process would have normally already updated the control file to the > consistent point. Something like th

Re: BUG #15346: Replica fails to start after the crash

2018-08-30 Thread Michael Paquier
On Thu, Aug 30, 2018 at 10:55:23AM +0200, Alexander Kukushkin wrote: > Bgwriter itself never changes updateMinRecoveryPoint to true and boom, > we can get a lot of pages written to disk, but minRecoveryPoint in the > pg_control won't be updated! That's indeed obvious by reading the code. The bgwr

Re: BUG #15346: Replica fails to start after the crash

2018-08-30 Thread Alexander Kukushkin
Hello hackers! It seems bgwriter running on the replicas is broken in the commit 8d68ee6 and as a result bgwriter never updates minRecoveryPoint in the pg_control.Please see a detailed explanation below. 2018-08-29 22:54 GMT+02:00 Michael Paquier : > This is not a solution in my opinion, as you