Re: Patch to implement pg_current_logfile() function

From: Kevin Grittner <kgrittn(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Gilles Darold <gilles(dot)darold(at)dalibo(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "Karl O(dot) Pinc" <kop(at)meme(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to implement pg_current_logfile() function
Date: 2017-01-13 16:43:25
Message-ID: CACjxUsOxLm8UQsBRXha++F5jxAWjj=3rjPk+_2wBdCJOeFwsJQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 13, 2017 at 7:09 AM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:

> There is no real harm in including current_logfiles in base
> backups, but that's really in the same bag as postmaster.opts or
> postmaster.pid, particularly if the log file name has a
> timestamp.

I'm going to dispute that -- if postmaster.opts and postmaster.pid
are present when you restore, it takes away a level of insurance
against restoring a corrupted image of the database without knowing
it. In particular, if the backup_label file is deleted (which
happens with alarmingly frequency), the startup code may think it
is dealing with a cluster that crashed rather than with a restore
of a backup. This often leads to corruption (anything from
"database can't start" to subtle index corruption that isn't
noticed for months). The presence of log files from the time of
the backup do not present a similar hazard.

So while I agree that there is no harm in including
current_logfiles in base backups, I object to the comparisons to
the more dangerous files.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-01-13 16:49:57 Re: [PATCH] Rename pg_switch_xlog to pg_switch_wal
Previous Message Antonin Houska 2017-01-13 16:42:23 Re: PoC: Grouped base relation