Skip site navigation (1) Skip section navigation (2)

Re: Standalone backends run StartupXLOG in an incorrect environment

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Standalone backends run StartupXLOG in an incorrect environment
Date: 2010-04-19 18:34:20
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
I wrote:
> The point is that a standalone backend will fail to execute recovery
> correctly:

After digging around a bit, it seems like the cleanest solution would be
to move the responsibility for calling StartupXLOG in a standalone
backend into InitPostgres.  At the point where the latter currently has

	 * Initialize local process's access to XLOG, if appropriate.  In
	 * bootstrap case we skip this since StartupXLOG() was run instead.
	if (!bootstrap)
		(void) RecoveryInProgress();

we'd add a couple of lines to call StartupXLOG if !IsUnderPostmaster,
and then remove the call from postgres.c.  I haven't tested this yet
but it looks like the correct state has been set up at that point.
Anyone see any obvious holes in the idea?

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Simon RiggsDate: 2010-04-19 19:10:49
Subject: Re: Thoughts on pg_hba.conf rejection
Previous:From: Simon RiggsDate: 2010-04-19 18:17:56
Subject: Re: Re: [COMMITTERS] pgsql: Tune GetSnapshotData() during Hot Standby by avoiding loop

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group