pgsql: Exit from base backups when shutdown is requested

Started by Magnus Haganderalmost 15 years ago9 messages
#1Magnus Hagander
magnus@hagander.net

Exit from base backups when shutdown is requested

When the exit waits until the whole backup completes, it may take
a very long time.

In passing, add back an error check in the main loop so we detect
clients that disconnect much earlier if the backup is large.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=688423d004f4092aed73c73a3281c281d476436d

Modified Files
--------------
src/backend/replication/basebackup.c | 14 +++++++++++++-
src/backend/replication/walsender.c | 16 ++++++++--------
src/include/replication/walsender.h | 2 ++
3 files changed, 23 insertions(+), 9 deletions(-)

#2Simon Riggs
simon@2ndQuadrant.com
In reply to: Magnus Hagander (#1)
Re: pgsql: Exit from base backups when shutdown is requested

On Fri, 2011-01-14 at 11:37 +0000, Magnus Hagander wrote:

Exit from base backups when shutdown is requested

When the exit waits until the whole backup completes, it may take
a very long time.

In passing, add back an error check in the main loop so we detect
clients that disconnect much earlier if the backup is large.

Please make that the last commit in this area for next week.

I want to get a base from which to solidify the sync rep code, and
associated patches.

I'm not saying there will be a code clash, but there may be a clash of
detail or intention that will make life more difficult for testing.

Thanks,

--
Simon Riggs http://www.2ndQuadrant.com/books/
PostgreSQL Development, 24x7 Support, Training and Services

#3Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Simon Riggs (#2)
Re: [COMMITTERS] pgsql: Exit from base backups when shutdown is requested

On 14.01.2011 14:10, Simon Riggs wrote:

Please make that the last commit in this area for next week.

I want to get a base from which to solidify the sync rep code, and
associated patches.

I'm not saying there will be a code clash, but there may be a clash of
detail or intention that will make life more difficult for testing.

I'm sorry, but it doesn't work that way. There's at least one serious
bug in there still
(http://archives.postgresql.org/message-id/4D302326.1000000@enterprisedb.com),
and the multiple-concurrent-backups patch is pending review/commit. And
there's one more feature me & Magnus would like to get in before the
release: including all the WAL files required to restore from the backup
in the backup tar itself - we'll see if that makes the release or not.

None of that should conflict seriously with the synch rep code, although
it's hard to tell without seeing the patch. And even if it does, we'll
just resolve the conflict, merge conflicts are not such a big deal.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

#4Magnus Hagander
magnus@hagander.net
In reply to: Heikki Linnakangas (#3)
Re: [COMMITTERS] pgsql: Exit from base backups when shutdown is requested

On Fri, Jan 14, 2011 at 13:16, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:

On 14.01.2011 14:10, Simon Riggs wrote:

Please make that the last commit in this area for next week.

I want to get a base from which to solidify the sync rep code, and
associated patches.

I'm not saying there will be a code clash, but there may be a clash of
detail or intention that will make life more difficult for testing.

I'm sorry, but it doesn't work that way. There's at least one serious bug in
there still
(http://archives.postgresql.org/message-id/4D302326.1000000@enterprisedb.com),
and the multiple-concurrent-backups patch is pending review/commit. And
there's one more feature me & Magnus would like to get in before the
release: including all the WAL files required to restore from the backup in
the backup tar itself - we'll see if that makes the release or not.

There's one more before that, which is the walsender parser patch. I
intend to get that in RSN, but the "include all wal files" will be a
while, though, I don't think either of us has started that one?

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

#5Simon Riggs
simon@2ndQuadrant.com
In reply to: Heikki Linnakangas (#3)
Re: [COMMITTERS] pgsql: Exit from base backups when shutdown is requested

On Fri, 2011-01-14 at 14:16 +0200, Heikki Linnakangas wrote:

On 14.01.2011 14:10, Simon Riggs wrote:

Please make that the last commit in this area for next week.

I want to get a base from which to solidify the sync rep code, and
associated patches.

I'm not saying there will be a code clash, but there may be a clash of
detail or intention that will make life more difficult for testing.

I'm sorry, but it doesn't work that way. There's at least one serious
bug in there still

I'm not clear why you haven't submitted this code to the CommitFest,
especially if it clearly hasn't been very well tested.

None of that should conflict seriously with the synch rep code, although
it's hard to tell without seeing the patch. And even if it does, we'll
just resolve the conflict, merge conflicts are not such a big deal.

It's even easier if you don't cause them in the first place.

My request is not unreasonable. Please be helpful, as you would expect
me to be if the roles were reversed.

--
Simon Riggs http://www.2ndQuadrant.com/books/
PostgreSQL Development, 24x7 Support, Training and Services

#6Robert Haas
robertmhaas@gmail.com
In reply to: Simon Riggs (#5)
Re: Re: [COMMITTERS] pgsql: Exit from base backups when shutdown is requested

On Fri, Jan 14, 2011 at 7:25 AM, Simon Riggs <simon@2ndquadrant.com> wrote:

My request is not unreasonable. Please be helpful, as you would expect
me to be if the roles were reversed.

I can't remember anyone other than you ever requesting that.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#7Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Simon Riggs (#5)
Re: [COMMITTERS] pgsql: Exit from base backups when shutdown is requested

On 14.01.2011 14:25, Simon Riggs wrote:

On Fri, 2011-01-14 at 14:16 +0200, Heikki Linnakangas wrote:

None of that should conflict seriously with the synch rep code, although
it's hard to tell without seeing the patch. And even if it does, we'll
just resolve the conflict, merge conflicts are not such a big deal.

It's even easier if you don't cause them in the first place.

My request is not unreasonable. Please be helpful, as you would expect
me to be if the roles were reversed.

Feel free to submit the patch against the snapshot of today. I will fix
any merge conflict that arises from changes to the base-backup stuff.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

#8Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#6)
Re: Re: [COMMITTERS] pgsql: Exit from base backups when shutdown is requested

Robert Haas <robertmhaas@gmail.com> writes:

On Fri, Jan 14, 2011 at 7:25 AM, Simon Riggs <simon@2ndquadrant.com> wrote:

My request is not unreasonable. Please be helpful, as you would expect
me to be if the roles were reversed.

I can't remember anyone other than you ever requesting that.

Yes. As Heikki said, it doesn't work that way.

regards, tom lane

#9Simon Riggs
simon@2ndQuadrant.com
In reply to: Robert Haas (#6)
Re: Re: [COMMITTERS] pgsql: Exit from base backups when shutdown is requested

On Fri, 2011-01-14 at 07:30 -0500, Robert Haas wrote:

On Fri, Jan 14, 2011 at 7:25 AM, Simon Riggs <simon@2ndquadrant.com> wrote:

My request is not unreasonable. Please be helpful, as you would expect
me to be if the roles were reversed.

I can't remember anyone other than you ever requesting that.

Meaning what? You're playing compliment to my originality? Thanks ;-)

--
Simon Riggs http://www.2ndQuadrant.com/books/
PostgreSQL Development, 24x7 Support, Training and Services