Re: pending patch: Re: Streaming replication and pg_xlogfile_name()

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Erik Rijkers <er(at)xs4all(dot)nl>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pending patch: Re: Streaming replication and pg_xlogfile_name()
Date: 2010-04-02 02:53:37
Message-ID: k2i3f0b79eb1004011953i463dadfdy39a6d22c7c1bdee8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 2, 2010 at 2:22 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> Can someone explain to me in plain language what problem this is
> trying to fix?  I'm having trouble figuring it out.

The problem is that pg_xlogfile_name(pg_last_xlog_receive_location()) and
pg_xlogfile_name(pg_last_xlog_replay_location()) might report an inaccurate
WAL file name because currently pg_xlogfile_name() always uses the current
timeline to calculate the WAL file name. For example, even though the last
applied WAL file is 000000010000000000000002, the standby wrongly reports
that 000000000000000000000002 has been applied last.

postgres=# SELECT l lsn, pg_xlogfile_name(l) filename FROM
pg_last_xlog_replay_location() AS l;
lsn | filename
-----------+--------------------------
0/200FF70 | 000000000000000000000002
(1 row)

$ ls sby/pg_xlog/
000000010000000000000002 000000010000000000000003 archive_status

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Fefelov 2010-04-02 03:07:37 Re: Feature request - function-based deferrable uniques.
Previous Message Pei He 2010-04-02 02:02:50 Problem of Magic Block in Postgres 8.2