Re: pg_xlogfile_name_offset() et al and recovery

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_xlogfile_name_offset() et al and recovery
Date: 2016-07-07 06:59:30
Message-ID: b1d81f71-faf6-5fa2-b647-aa9097f94428@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2016/05/19 17:34, Amit Langote wrote:
> Currently in HEAD and 9.6, one can issue a non-exclusive backup on
> standby, so this is OK:
>
> select pg_is_in_recovery();
> pg_is_in_recovery
> -------------------
> t
> (1 row)
>
> select pg_start_backup('sby-bkp-test', 'f', 'f');
> pg_start_backup
> -----------------
> 0/5000220
> (1 row)
>
> However the following happens:
>
> select pg_xlogfile_name_offset(pg_start_backup('sby-bkp-test', 'f', 'f'));
> ERROR: recovery is in progress
> HINT: pg_xlogfile_name_offset() cannot be executed during recovery.
>
> Should this restriction be relaxed or am I missing something?

Answering my own question:

While reading the thread "BUG #14230: Wrong timeline returned by
pg_stop_backup on a standby", I came to know that ThisTimelineId is
invalid on standby. And because pg_xlogfile_name_offset() uses the same
to compute its result, it makes sense to prevent it from being used on a
standby.

Thanks,
Amit

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2016-07-07 07:04:24 Re: Reviewing freeze map code
Previous Message Michael Paquier 2016-07-07 06:38:26 Re: BUG #14230: Wrong timeline returned by pg_stop_backup on a standby