pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Implement backup API functions for non-exclusive backups
5+ messages / 3 participants
[nested] [flat]

* pgsql: Implement backup API functions for non-exclusive backups
@ 2016-04-05 18:11  Magnus Hagander <magnus@hagander.net>
  0 siblings, 2 replies; 5+ messages in thread

From: Magnus Hagander @ 2016-04-05 18:11 UTC (permalink / raw)
  To: pgsql-committers

Implement backup API functions for non-exclusive backups

Previously non-exclusive backups had to be done using the replication protocol
and pg_basebackup. With this commit it's now possible to make them using
pg_start_backup/pg_stop_backup as well, as long as the backup program can
maintain a persistent connection to the database.

Doing this, backup_label and tablespace_map are returned as results from
pg_stop_backup() instead of being written to the data directory. This makes
the server safe from a crash during an ongoing backup, which can be a problem
with exclusive backups.

The old syntax of the functions remain and work exactly as before, but since the
new syntax is safer this should eventually be deprecated and removed.

Only reference documentation is included. The main section on backup still needs
to be rewritten to cover this, but since that is already scheduled for a separate
large rewrite, it's not included in this patch.

Reviewed by David Steele and Amit Kapila

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7117685461af50f50c03f43e6a622284c8d54694

Modified Files
--------------
doc/src/sgml/func.sgml                 |  48 ++++++---
src/backend/access/transam/xlog.c      |  55 +++++-----
src/backend/access/transam/xlogfuncs.c | 185 ++++++++++++++++++++++++++++++++-
src/backend/catalog/system_views.sql   |   2 +-
src/backend/replication/basebackup.c   |  17 +--
src/include/access/xlog.h              |   4 +-
src/include/access/xlog_fn.h           |   1 +
src/include/catalog/catversion.h       |   2 +-
src/include/catalog/pg_proc.h          |   4 +-
9 files changed, 265 insertions(+), 53 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Implement backup API functions for non-exclusive backups
@ 2016-04-05 18:35  Robert Haas <robertmhaas@gmail.com>
  parent: Magnus Hagander <magnus@hagander.net>
  1 sibling, 1 reply; 5+ messages in thread

From: Robert Haas @ 2016-04-05 18:35 UTC (permalink / raw)
  To: Magnus Hagander <magnus@hagander.net>; +Cc: pgsql-committers

On Tue, Apr 5, 2016 at 2:11 PM, Magnus Hagander <magnus@hagander.net> wrote:
> Implement backup API functions for non-exclusive backups
>
> Previously non-exclusive backups had to be done using the replication protocol
> and pg_basebackup. With this commit it's now possible to make them using
> pg_start_backup/pg_stop_backup as well, as long as the backup program can
> maintain a persistent connection to the database.
>
> Doing this, backup_label and tablespace_map are returned as results from
> pg_stop_backup() instead of being written to the data directory. This makes
> the server safe from a crash during an ongoing backup, which can be a problem
> with exclusive backups.
>
> The old syntax of the functions remain and work exactly as before, but since the
> new syntax is safer this should eventually be deprecated and removed.
>
> Only reference documentation is included. The main section on backup still needs
> to be rewritten to cover this, but since that is already scheduled for a separate
> large rewrite, it's not included in this patch.
>
> Reviewed by David Steele and Amit Kapila

We've typically tried to keep the width of commit messages narrow
enough that 'git log' looks OK in an 80-character window; this one is
wide enough that it doesn't.

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


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Implement backup API functions for non-exclusive backups
@ 2016-04-05 18:40  Magnus Hagander <magnus@hagander.net>
  parent: Robert Haas <robertmhaas@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Magnus Hagander @ 2016-04-05 18:40 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: pgsql-committers

On Tue, Apr 5, 2016 at 8:35 PM, Robert Haas <robertmhaas@gmail.com> wrote:

> On Tue, Apr 5, 2016 at 2:11 PM, Magnus Hagander <magnus@hagander.net>
> wrote:
> > Implement backup API functions for non-exclusive backups
> >
> > Previously non-exclusive backups had to be done using the replication
> protocol
> > and pg_basebackup. With this commit it's now possible to make them using
> > pg_start_backup/pg_stop_backup as well, as long as the backup program can
> > maintain a persistent connection to the database.
> >
> > Doing this, backup_label and tablespace_map are returned as results from
> > pg_stop_backup() instead of being written to the data directory. This
> makes
> > the server safe from a crash during an ongoing backup, which can be a
> problem
> > with exclusive backups.
> >
> > The old syntax of the functions remain and work exactly as before, but
> since the
> > new syntax is safer this should eventually be deprecated and removed.
> >
> > Only reference documentation is included. The main section on backup
> still needs
> > to be rewritten to cover this, but since that is already scheduled for a
> separate
> > large rewrite, it's not included in this patch.
> >
> > Reviewed by David Steele and Amit Kapila
>
> We've typically tried to keep the width of commit messages narrow
> enough that 'git log' looks OK in an 80-character window; this one is
> wide enough that it doesn't.
>

Huh. It would appear I've somehow screwed up the commit-message-mode that
is supposed to warn me about that.

My apologies.


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

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Implement backup API functions for non-exclusive backups
@ 2016-04-06 16:38  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Magnus Hagander <magnus@hagander.net>
  1 sibling, 1 reply; 5+ messages in thread

From: Tom Lane @ 2016-04-06 16:38 UTC (permalink / raw)
  To: Magnus Hagander <magnus@hagander.net>; +Cc: pgsql-committers

Magnus Hagander <magnus@hagander.net> writes:
> Implement backup API functions for non-exclusive backups

Shouldn't the CF entry for this be closed?  The docs rewrite
seems like a separate task.

			regards, tom lane


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Implement backup API functions for non-exclusive backups
@ 2016-04-06 16:41  Magnus Hagander <magnus@hagander.net>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Magnus Hagander @ 2016-04-06 16:41 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers

On Wed, Apr 6, 2016 at 6:38 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Magnus Hagander <magnus@hagander.net> writes:
> > Implement backup API functions for non-exclusive backups
>
> Shouldn't the CF entry for this be closed?  The docs rewrite
> seems like a separate task.
>
>
It should. I forgot, thanks for the reminder. Done now.


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

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2016-04-06 16:41 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-04-05 18:11 pgsql: Implement backup API functions for non-exclusive backups Magnus Hagander <magnus@hagander.net>
2016-04-05 18:35 ` Robert Haas <robertmhaas@gmail.com>
2016-04-05 18:40   ` Magnus Hagander <magnus@hagander.net>
2016-04-06 16:38 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-04-06 16:41   ` Magnus Hagander <magnus@hagander.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox