Re: PANIC during crash recovery of a recently promoted standby
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Pavan Deolasee <pavan.deolasee@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2018-05-11T03:38:34Z
Lists: pgsql-hackers
On Thu, May 10, 2018 at 10:52:12AM +0530, Pavan Deolasee wrote: > I propose that we should always clear the minRecoveryPoint after promotion > to ensure that crash recovery always run to the end if a just-promoted > standby crashes before completing its first regular checkpoint. A WIP patch > is attached. I have been playing with your patch and upgraded the test to check as well for cascading standbys. We could use that in the final patch. That's definitely something to add in the recovery test suite, and the sleep phases should be replaced by waits on replay and/or flush. Still, that approach looks sensitive to me. A restart point could be running while the end-of-recovery record is inserted, so your patch could update minRecoveryPoint to InvalidXLogRecPtr, and then a restart point would happily update again the control file's minRecoveryPoint to lastCheckPointEndPtr because it would see that the former is older than lastCheckPointEndPtr (let's not forget that InvalidXLogRecPtr is 0), so you could still crash on invalid pages? I need to think a bit more about that stuff, but one idea would be to use a special state in the control file to mark it as ending recovery, this way we would control race conditions with restart points. -- Michael
Commits
-
Prevent references to invalid relation pages after fresh promotion
- 56535dcdc9e2 9.3.24 landed
- f352f43d3f10 9.4.19 landed
- 23eef5cd7ffc 9.5.14 landed
- 8d68ee6f31ca 9.6.10 landed
- 6716f2f96256 10.5 landed
- 9a1bd8271172 11.0 landed
- 3c64dcb1e35d 12.0 landed