Re: Latest version of Hot Standby patch

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Latest version of Hot Standby patch
Date: 2009-01-08 11:52:20
Message-ID: 1231415540.18005.149.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Wed, 2009-01-07 at 13:18 +0200, Heikki Linnakangas wrote:
> There's still something wrong with the way subtransactions are handled.
> I got:
>
> postgres=# SELECT * FROM foo;
> ERROR: could not access status of transaction 118649
> DETAIL: Could not open file "pg_subtrans/0001": No such file or directory.
>
> in the standby after some testing.

Currently, we don't run TruncateSubtrans() when we perform
restartpoints. That means that it's impossible for HS to see an xid as
running for which it's segment has been deleted. The only other
possibility is that the segment has not yet been created.

subtrans is not WAL logged, so new subtrans pages are never created
during recovery, so not yet created is a typical case.

This looks to be essentially the same error I had already fixed, just
that my fix in slru.c is not sufficient. The reason for this is that
initially this error occurred on the startup process when attempting to
record a subtransaction start. Now that has been optimised away, the
same error occurs, but now while reading rather than writing.

We don't wish to introduce WAL logging of subtrans, so the correct fix
is to simply widen the error-checking in SlruPhysicalReadPage() from
using InRecovery to IsRecoveryProcessingMode(). That then causes us to
return zeroes for the page requested rather than error out.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-01-08 12:38:02 Re: Latest version of Hot Standby patch
Previous Message Rushabh Lathia 2009-01-08 10:23:21 Segmentation fault on PG 8.4 CVS head