Re: Hot standby, RestoreBkpBlocks and cleanup locks

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Hot standby, RestoreBkpBlocks and cleanup locks
Date: 2009-01-15 16:05:50
Message-ID: 496F5EDE.7080400@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2009-01-15 16:11:31 Re: FWD: Re: Updated backslash consistency patch
Previous Message Bernd Helmle 2009-01-15 16:04:44 Re: FWD: Re: Updated backslash consistency patch