Re: reaper should restart archiver even on standby

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: reaper should restart archiver even on standby
Date: 2015-06-10 14:12:16
Message-ID: 20150610141216.GX133018@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujii Masao wrote:
> On Tue, Jun 9, 2015 at 5:21 AM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
> > Fujii Masao wrote:

> > Can't we create
> > some common function that would be called both here and on ServerLoop?
>
> Agreed. So, what about the attached patch?

No attachment ...

> > We also have sigusr1_handler that starts an archiver -- why does that
> > one use different conditions?
>
> Because that code path can be reached only during recovery.
> So XLogArchivingActive() which indicates whether archiver is
> allowed to start during normal processing doesn't need to be
> checked there.

Makes sense.

> OTOH, in the other places where archiver is started up,
> we can reach there during not only recovery but also normal processing.
> So the conditions that we need to check are different.

I think it would be simpler to centralize knowledge in a single
function, and have that function take an argument indicating whether
we're in recovery or normal processing, instead of spreading it to every
place that can possibly start the archiver.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2015-06-10 14:18:10 Re: s_lock() seems too aggressive for machines with many sockets
Previous Message Nils Goroll 2015-06-10 14:12:05 Re: s_lock() seems too aggressive for machines with many sockets