Terminating pg_basebackup background streamer - Mailing list pgsql-hackers

From Magnus Hagander
Subject Terminating pg_basebackup background streamer
Date
Msg-id CABUevEzp2PwMTP7K5OVZsPOKrtZW3+yVL=8D=p8DgJ3Kd2Wqeg@mail.gmail.com
Whole thread Raw
Responses Re: Terminating pg_basebackup background streamer  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
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?


Should we perhaps also consider adding a sigterm handler to pg_basebackup, so if you send it a SIGTERM it kills off the background process as well?


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

pgsql-hackers by date:

Previous
From: Hardy Falk
Date:
Subject: notify duplicate elimination
Next
From: Fabien COELHO
Date:
Subject: Re: gaussian distribution pgbench