Minor changes to Recovery related code

From: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Minor changes to Recovery related code
Date: 2007-03-30 10:20:04
Message-ID: 1175250004.4386.723.camel@silverbirch.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

I'd like to make the following changes to recovery related code over the
next few days/weeks. If anybody insists I do this by freeze or not at
all, then I'll submit patches for 1,3,4,5,10 before Saturday night. I'd
rather take a bit more time and do this in one drop and there are some
code dependencies between these changes and other patches from
Koichi-san and myself.

1. Current xlog should be archived at shutdown for smart shutdown
- check that archiver is active prior to shutdown checkpoint request
- if (shutdown checkpoint && XLogArchivingActive()) RequestXLogSwitch()
- for smart shutdown, have archiver complete its work before exiting

2. pg_stop_backup() should wait until all archive files are safely
archived before returning

3. Need a %r parameter for restore_command, to allow the restore command
be passed the name of the file containing the last restartpoint. This
will allow the restore command to clean down old archive files more
safely/cleanly in Warm Standby operation.
- change to pg_standby to accept the parameter and use %r rather than -k
parameter

4. Add an option to pg_standby to have it complete all outstanding
archive files after it has been triggered, minimising data loss at the
slight expense of cut-over time

5. log_restartpoint option in recovery.conf
LOG each restorepoint, so can understand whether restartable recovery
will be effective or not

6. refactor recovery.conf so that it uses a GUC-like parser

7. refactor all xlog _desc routines into one module, so these can be
more easily used by xlogviewer utility

8. get xlogviewer utility a freshen-up so it can be part of main
release, possibly including further refactoring of xlog.c

9. Another round of doc updates to highlight the use of pg_standby and
Koichi-san's work. I think Doug Knight might have some additional code
examples to include as well, from previous discussions.

10. Changes to ensure WAL-avoiding operations and hot backups cannot be
executed simultaneously. One of these two options, ISTM:

a) Following a change to archive_command while server is running. Log
the xid of the WAL-avoiding operations when they start and have
pg_start_backup() wait for those xids to complete before continuing.

b) Introduce a new parameter, archive_mode = on | off that can only be
set at server start. If archive_mode = on then XLogArchivingActive();
archiving only takes place when archive_command is not ''. This allows
archive_command to be changed while server running, yet without any
danger from WAL-avoiding operations.

[7 & 8 would be complete by about 5-6 weeks from now. Others much
earlier]

Comments?

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Huxton 2007-03-30 10:27:10 Re: [PATCHES] Full page writes improvement, code update
Previous Message Simon Riggs 2007-03-30 10:15:16 Re: [PATCHES] Full page writes improvement, code update

Browse pgsql-patches by date

  From Date Subject
Next Message Richard Huxton 2007-03-30 10:27:10 Re: [PATCHES] Full page writes improvement, code update
Previous Message Simon Riggs 2007-03-30 10:15:16 Re: [PATCHES] Full page writes improvement, code update