Re: pg_stat_archiver issue with aborted archiver

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Julien Rouhaud <julien(dot)rouhaud(at)dalibo(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat_archiver issue with aborted archiver
Date: 2015-06-09 01:33:04
Message-ID: CAB7nPqRtvJbKpqVQC=Qvn3TDHoxDjtk54mPxOmwDQ4LkRkuriA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 9, 2015 at 4:23 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Mon, Jun 8, 2015 at 5:17 PM, Julien Rouhaud
> <julien(dot)rouhaud(at)dalibo(dot)com> wrote:
>> Le 08/06/2015 05:56, Michael Paquier a écrit :
>>> On Sun, Jun 7, 2015 at 1:11 AM, Julien Rouhaud
>>> <julien(dot)rouhaud(at)dalibo(dot)com> wrote:
>>>> I just noticed that if the archiver aborts (for instance if the
>>>> archive_command exited with a return code > 127),
>>>> pg_stat_archiver won't report those failed attempts. This happens
>>>> with both 9.4 and 9.5 branches.
>>>>
>>>> Please find attached a patch that fix this issue, based on
>>>> current head.
>>>
>>> The current code seems right to me. When the archive command dies
>>> because of a signal (exit code > 128), the server should fail
>>> immediately with FATAL and should not do any extra processing.
>
> In that case, ISTM that the archiver process dies with FATAL but
> the server not. No? Then the archiver is restarted by postmaster.
> If my understanding is right, it seems worth applying something like
> Julien's patch.

Er, sure. Please understand the archiver process... My point is that
3ad0728 introduced the behavior that we have now in pgarch.c, and that
we should immediately bail out from the archiver process without
interacting with pgstat, the archiver coming back to this file
archiving at restart, and only use pgstat_send_archiver when there is
a status from pgarch_archiveXlog().
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2015-06-09 03:19:24 Re: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file
Previous Message Michael Paquier 2015-06-09 01:09:02 Re: Memory leak with XLogFileCopy since de768844 (WAL file with .partial)