Proposal: improve shutdown during online backup - Mailing list pgsql-hackers

From Albe Laurenz
Subject Proposal: improve shutdown during online backup
Date
Msg-id D960CB61B694CF459DCFB4B0128514C201E6780F@exadv11.host.magwien.gv.at
Whole thread Raw
Responses Re: Proposal: improve shutdown during online backup
Re: Proposal: improve shutdown during online backup
List pgsql-hackers
I'm referring to the discussion in this thread:
http://archives.postgresql.org/pgsql-hackers/2007-11/msg00946.php

As expressed in the thread, I think that there should not be
a backup_label file in the data directory after a clean shutdown,
because
a) it's probably an oversight anyway (someone forgot to  call pg_stop_backup) and
b) it will force an unnecessary recovery at server restart,  which will sometimes fail (if the WAL file is no longer
there).

This is my proposal:

1) On "pg_ctl stop|restart -m smart", check if online backup is  in progress and do not shutdown in this case (treat
theonline  backup like an open connection).
 
2) On "pg_ctl stop|restart -m fast", remove backup_label after  the server has been brought down successfully.

If that's acceptable, I'd be willing to work on it.

Yours,
Laurenz Albe

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [DOCS] pg_total_relation_size() and CHECKPOINT
Next
From: "Gurjeet Singh"
Date:
Subject: having problem in rsync'ing cvs