Re: xlog file naming

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: xlog file naming
Date: 2011-09-13 01:44:53
Message-ID: CAHGQGwE8rK8ZrSU=brAJuEAsOChRyvdRCeezA2ZY6gPmT-wu_A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 13, 2011 at 3:36 AM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> The return value of pg_start_backup that currently looks something like
>
>  pg_start_backup
> -----------------
>  8D1/C9013758
>
> should really be
>
>  000008D1C9013758
>
> (perhaps the timeline should be included?)

This change might break some tools which depends on such a result format.
Instead of that, what about introducing something like pg_current_timeline()
function which literally returns the current timeline ID, and extending
pg_xlogfile_name() so that it accepts not only LSN but also the timeline?
This idea enables us to get the backup start WAL file name by executing
"SELECT pg_xlogfile_name(pg_current_timeline(), pg_start_backup());".

Furthermore, in the same way, we can get the backup end WAL file name or
current WAL file name from pg_stop_backup() or pg_current_xlog_location(),
respectively.

> and similarly, log output and pg_controldata output like
>
> Latest checkpoint location:           8D3/5A1BB578
>
> should be
>
> Latest checkpoint location:           000008D35A1BB578

LSN information is useful for at least debug purpose. So, what about leaving
LSN information as it is and appending the filename in the end-of-line
as follows?
backup_label represents the backup start location in this way.

Latest checkpoint location: 0/2000020 (file 0000000000000002)

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 Robert Haas 2011-09-13 03:09:24 Re: Alpha 1 for 9.2
Previous Message Tatsuo Ishii 2011-09-13 01:01:25 show pool_status like...