Re: [PATCHES] Infrastructure changes for recovery (v8)

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Infrastructure changes for recovery (v8)
Date: 2008-11-17 13:51:30
Message-ID: 492176E2.1000006@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Simon Riggs wrote:
> diff --git a/src/backend/access/transam/subtrans.c b/src/backend/access/transam/
> index 063b366..5e64cb4 100644
> --- a/src/backend/access/transam/subtrans.c
> +++ b/src/backend/access/transam/subtrans.c
> @@ -226,6 +226,9 @@ ZeroSUBTRANSPage(int pageno)
> *
> * oldestActiveXID is the oldest XID of any prepared transaction, or nextXid
> * if there are none.
> + *
> + * Note that this is not atomic and is not yet safe to perform while other
> + * processes might access subtrans.
> */
> void
> StartupSUBTRANS(TransactionId oldestActiveXID)

I'm a bit confused by that comment. Does that need to be fixed? It
sounds like it does, because other processes might access subtrans when
StartupSUBTRANS is called, with the patch to allow read-only queries
during recovery. Or is that done in the hot standby patch?

However, I don't see why that isn't safe. StartupSUBTRANS takes the
SubtransControlLock in exclusive mode while it zeroes out subtrans.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2008-11-17 14:09:57 Re: PG_PAGE_LAYOUT_VERSION 5 - time for change
Previous Message Heikki Linnakangas 2008-11-17 13:44:19 Re: Synchronous replication patch v2

Browse pgsql-patches by date

  From Date Subject
Next Message Heikki Linnakangas 2008-11-17 14:18:39 Re: [PATCHES] Infrastructure changes for recovery (v8)
Previous Message Hiroshi Saito 2008-11-16 13:36:50 Re: [PATCHES] Solve a problem of LC_TIME of windows.