Hot standby, RestoreBkpBlocks and cleanup locks

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Hot standby, RestoreBkpBlocks and cleanup locks
Date: 2009-01-09 16:30:59
Message-ID: 49677BC3.5090105@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The hot standby patch has some hacks to decide which full-page-images
can be restored holding an exclusive lock and which ones need a
vacuum-strength lock. It's not very pretty as is, as mentioned in
comments too.

How about we refactor things so that redo-functions are responsible for
calling RestoreBkpBlocks? The redo function can then pass an argument
indicating what kind of lock is required. We should also change
XLogReadBufferExtended so that it doesn't lock the page; the caller
knows better what kind of a lock it needs. That makes it more analogous
with ReadBufferExtended too, although I think we should keep
XLogReadBuffer() unchanged for now.

See attached patch. One shortfall of this patch is that you can pass
only one argument to RestoreBkpBlocks, but there can multiple backup
blocks in one WAL record. That's OK in current usage, though.

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

Attachment Content-Type Size
restorebkpblocks-refactor-1.patch text/x-diff 8.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-01-09 16:31:07 Re: Improving compressibility of WAL files
Previous Message Tom Lane 2009-01-09 16:24:55 Re: foreign_data test fails with non-C locale