Re: pgsql: Forbid using pg_xlogfile_name() and pg_xlogfile_name_offset()

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <heikki(at)postgresql(dot)org>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Forbid using pg_xlogfile_name() and pg_xlogfile_name_offset()
Date: 2010-04-07 09:41:36
Message-ID: 1270633296.24910.6600.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Wed, 2010-04-07 at 06:12 +0000, Heikki Linnakangas wrote:
> Log Message:
> -----------
> Forbid using pg_xlogfile_name() and pg_xlogfile_name_offset() during
> recovery. We might want to relax this in the future, but ThisTimeLineID
> isn't currently correct in backends during recovery, so the filename
> returned was wrong.

Any reason why we couldn't just do this:

if (RecoveryInProgress())
{
volatile XLogCtlData *xlogctl = XLogCtl;
XLogFileName(xlogfilename, xlogctl->ThisTimeLineID,
xlogid, xlogseg);
}
else
XLogFileName(xlogfilename, ThisTimeLineID, xlogid, xlogseg);

rather than preventing access to those functions completely?

--
Simon Riggs www.2ndQuadrant.com

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-04-07 10:23:24 Re: [COMMITTERS] pgsql: Forbid using pg_xlogfile_name() and pg_xlogfile_name_offset()
Previous Message Heikki Linnakangas 2010-04-07 06:12:52 pgsql: Forbid using pg_xlogfile_name() and pg_xlogfile_name_offset()

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-04-07 10:02:04 Re: Streaming replication and a disk full in primary
Previous Message Dave Page 2010-04-07 09:30:54 Re: fallback_application_name and pgbench