Prev: pg_migrator
Next: [HACKERS] CP949 for EUC-KR?
From: Simon Riggs on 27 Apr 2010 08:58 On Tue, 2010-04-27 at 12:25 +0300, Heikki Linnakangas wrote: > Fujii Masao wrote: > > On Tue, Apr 27, 2010 at 4:19 PM, Heikki Linnakangas > > <heikki.linnakangas(a)enterprisedb.com> wrote: > >> Hmm, we could throw an error in the standby, when we see a shutdown > >> checkpoint while we're waiting for an end-backup record. If the database > >> was shut down before pg_stop_backup(), we know that the backup was > >> cancelled and the end-backup record we're waiting for will never arrive. > > > > Sounds good. This would work fine even if an immediate shutdown is done > > instead since the primary ends up generating a shutdown checkpoint record > > when restarting. > > Yep. I've committed a patch to do that. We should be able to do this earlier in the run. If pg_stop_backup() is run it creates the .backup file in the archive. In the absence of that file, we should be able to work out that pg_stop_backup() was not run. Almost, because we support starting recovery without need to run start/stop backup. If we introduced a special option for that in recovery.conf it would be much simpler to fail if the file were unavailable. -- Simon Riggs www.2ndQuadrant.com -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Tom Lane on 27 Apr 2010 09:51 Heikki Linnakangas <heikki.linnakangas(a)enterprisedb.com> writes: > Hmm, we could throw an error in the standby, when we see a shutdown > checkpoint while we're waiting for an end-backup record. If the database > was shut down before pg_stop_backup(), we know that the backup was > cancelled and the end-backup record we're waiting for will never arrive. Isn't the above statement complete nonsense? There's nothing to stop the DBA from issuing pg_stop_backup() after he restarts the master. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Heikki Linnakangas on 27 Apr 2010 11:04 Tom Lane wrote: > Heikki Linnakangas <heikki.linnakangas(a)enterprisedb.com> writes: >> Hmm, we could throw an error in the standby, when we see a shutdown >> checkpoint while we're waiting for an end-backup record. If the database >> was shut down before pg_stop_backup(), we know that the backup was >> cancelled and the end-backup record we're waiting for will never arrive. > > Isn't the above statement complete nonsense? There's nothing to stop > the DBA from issuing pg_stop_backup() after he restarts the master. pg_stop_backup() can't be called if there's no backup in progress. Restart cancels it. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Heikki Linnakangas on 27 Apr 2010 11:07 Robert Haas wrote: > On Tue, Apr 27, 2010 at 5:25 AM, Heikki Linnakangas > <heikki.linnakangas(a)enterprisedb.com> wrote: >> Yep. I've committed a patch to do that. > > Is there no way for the slave to recover from this situation? No, it will never open up for hot standby, and it will error at the end of recovery anyway. This just makes it happen earlier and with a smarter error message. In theory, if the data directory was fully copied by the time of the shutdown/crash and the only thing that was missing was pg_stop_backup(), all the data is there, so you could get a consistent database. But we can't know if it's consistent or not, so we don't allow it. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Heikki Linnakangas on 27 Apr 2010 11:13
Simon Riggs wrote: > If pg_stop_backup() is run it creates the .backup file in the archive. > In the absence of that file, we should be able to work out that > pg_stop_backup() was not run. It's just as likely that the file is there even though the backup didn't finish, though. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |