Re: Terminating pg_basebackup background streamer

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Terminating pg_basebackup background streamer
Date: 2014-02-12 17:47:09
Message-ID: CABUevExwwnZEfzd6QVRndOAw5dufbsX_G6HEhZp9Lpb+2=nzeA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 10, 2014 at 7:39 PM, Magnus Hagander <magnus(at)hagander(dot)net>wrote:

> On Mon, Feb 10, 2014 at 7:29 PM, Heikki Linnakangas <
> hlinnakangas(at)vmware(dot)com> wrote:
>
>> On 02/09/2014 02:17 PM, Magnus Hagander wrote:
>>
>>> If an error occurs in the foreground (backup) process of pg_basebackup,
>>> and
>>> we exit in a controlled way, the background process (streaming xlog
>>> process) would stay around and keep streaming.
>>>
>>> This can happen for example if disk space runs out and there is very low
>>> activity on the server. (If there is activity on the server, the
>>> background
>>> streamer will also run out of disk space and exit)
>>>
>>> Attached patch kills it off in disconnect_and_exit(), which seems like
>>> the
>>> right thing to do to me.
>>>
>>> Any objections to applying and backpatching that for the upcoming minor
>>> releases?
>>>
>>
>> Do you get a different error message with this patch than before? Is the
>> new one better than the old one?
>
>
> Previously you got double error messages - one from the foreground, and a
> second one from the background sometime in the future (whenever it
> eventually failed, and for whatever reason - so if it was out of disk
> space, it would complain about that once it got enough xlog for it to
> happen).
>
> With the patch you just get the error message from the first process. The
> background process doesn't give an error on SIGTERM, it just exists.
>
>
>
Since there were no other objections, I've applied this patch.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2014-02-12 18:07:33 Re: truncating pg_multixact/members
Previous Message Tom Lane 2014-02-12 17:38:01 Re: Recovery inconsistencies, standby much larger than primary