Skip site navigation (1) Skip section navigation (2)

pg_start_backup without checkpoint patch (a part of Synch Rep)

From: "Fujii Masao" <masao(dot)fujii(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_start_backup without checkpoint patch (a part of Synch Rep)
Date: 2008-12-27 12:28:52
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

Attached is the self-contained patch to skip checkpoint at pg_start_backup.
This is a part of Synch Rep patches, and was discussed in the following

In Synch Rep, we basically have to get a fresh backup, to make the failed
server catch up with the primary after failover. But getting an online-backup
is expensive operation because of pg_start_backup's checkpoint and data
copying. Especially since pg_start_backup is performed as one transaction,
its checkpoint might not only increase I/O traffic but also cause
long-transaction which prevents VACUUM and HOT. This patch makes
pg_start_backup skip a checkpoint if possible, and works out the above

Specifically, pg_start_backup uses the last checkpoint instead of doing a
new checkpoint if full_page_writes = on since the last checkpoint, which
guarantees that all the full-pages required for PITR are written.

There is one constraint: XLR_BKP_REMOVABLE flag cannot be marked
correctly, because we cannot judge whether the full-pages (generated
before pg_start_backup) are removal or not. AFAIK, this flag is only used
by pglesslog. Should we add a new option to specify whether checkpoint
is skippable, for the backward compatibility?


Fujii Masao
NTT Open Source Software Center

Attachment: bkp_without_ckpt_v3.patch
Description: text/x-patch (25.4 KB)


pgsql-hackers by date

Next:From: Hitoshi HaradaDate: 2008-12-27 13:26:23
Subject: Re: Tuplestore trimming in window-functions patch
Previous:From: Gregory StarkDate: 2008-12-27 06:04:45
Subject: Re: V3 of PITR performance improvement for 8.4 (WIP)

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group