Re: Hot standby, RestoreBkpBlocks and cleanup locks - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Hot standby, RestoreBkpBlocks and cleanup locks
Date
Msg-id 496F5EDE.7080400@enterprisedb.com
Whole thread Raw
In response to Re: Hot standby, RestoreBkpBlocks and cleanup locks  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Hot standby, RestoreBkpBlocks and cleanup locks  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
Simon Riggs wrote:
> The idea outlined before didn't deal with all call points for
> RecordIsCleanupRecord(), so doesn't actually work.

Are we talking about the same thing? If we put the control of locking to 
the hands of the redo-function, I don't see why it couldn't use a lock 
of the right strength. Surely the redo-function can be taught what lock 
it needs to take.

> ISTM easier to do things within the rmgr at the time WAL records are
> written, rather than in the rmgr while handling redo.

I don't like that idea. I'd like to keep the coupling between the 
primary and standby to the minimum.

> This avoids another rmgr call and is much more straightforward since we
> define how to redo the record at the time it is written, rather than via
> a separate mechanism that could mismatch. 

The code that generates a WAL record and the redo-functions need to 
match in general anyway. The strength of the lock is not any more 
error-prone than other things that a redo-function must do.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Bernd Helmle
Date:
Subject: Re: FWD: Re: Updated backslash consistency patch
Next
From: Bruce Momjian
Date:
Subject: Re: FWD: Re: Updated backslash consistency patch