Re: Streaming replication and pg_xlogfile_name()

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Erik Rijkers <er(at)xs4all(dot)nl>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Streaming replication and pg_xlogfile_name()
Date: 2010-03-02 07:08:19
Message-ID: 3f0b79eb1003012308p7ac146d3k27854bb75d974ffe@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sorry for the delay.

On Fri, Feb 26, 2010 at 6:26 AM, Erik Rijkers <er(at)xs4all(dot)nl> wrote:
> With this patch the standby compiles, tests, installs OK.
> I wanted to check with you if the following is expected.

Thanks for the test and bug report!

> With standby (correctly) as follows :
> LOG:  redo starts at 0/1000020
> LOG:  consistent recovery state reached at 0/2000000
> LOG:  database system is ready to accept read only connections
>
> This is OK.
>
> However, initially (even after the above 'ready' message)
> the timeline value as reported by
>  pg_xlogfile_name_offset(pg_last_xlog_replay_location())
> is zero.

When we try to read the WAL record discontinuously (e.g., the REDO
starting record and the last applied record), the lastPageTLI is
always reset. If that record is not in the buffer, it's read from
the disk and the lastPageTLI is set to the right timeline. Otherwise,
the lastPageTLI remains at zero wrongly. This is the cause of the
problem that you reported.

I revised the patch so that the lastPageTLI is always set correctly.
Please try this new patch.

Regards,

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

Attachment Content-Type Size
extend_format_of_recovery_info_funcs_v3.patch text/x-patch 14.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-03-02 07:11:50 Re: pg_stop_backup does not complete
Previous Message Nikhil Sontakke 2010-03-02 06:48:22 Re: plpgsql: numeric assignment to an integer variable errors out