Re: An example of bugs for Hot Standby
Simon Riggs <simon@2ndquadrant.com>
From: Simon Riggs <simon@2ndQuadrant.com>
To: Hiroyuki Yamada <yamada@kokolink.net>, Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org
Date: 2010-01-21T10:05:05Z
Lists: pgsql-hackers
Attachments
- sigalrm_startupbufferpin.v2.patch (text/x-patch) patch v2
On Thu, 2010-01-21 at 18:01 +0900, Hiroyuki Yamada wrote: > >Deadlock bug was prevented by stop-gap measure in December commit. > > > >Full resolution patch attached for Startup process waits on buffer pins. > > > >Startup process sets SIGALRM when waiting on a buffer pin. If woken by > >alarm we send SIGUSR1 to all backends requesting that they check to see > >if they are blocking Startup process. If so, they throw ERROR/FATAL as > >for other conflict resolutions. Deadlock stop gap removed. > >max_standby_delay = -1 option removed to prevent deadlock. > > > >Reviews welcome, otherwise commit at end of week. > > > > I think the patch has two problems. > > * disable_standby_sig_alarm() does not clear standby_timeout_active flag > when it succeeds in disabling the alarm. > > * Assertion check in HoldingBufferPinThatDelaysRecovery() can fail > with following scenario. Updated patch, including changes from Andres and Hiroyuki. -- Simon Riggs www.2ndQuadrant.com