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?
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center
pgsql-hackers by date
|Next:||From: Hitoshi Harada||Date: 2008-12-27 13:26:23|
|Subject: Re: Tuplestore trimming in window-functions patch|
|Previous:||From: Gregory Stark||Date: 2008-12-27 06:04:45|
|Subject: Re: V3 of PITR performance improvement for 8.4 (WIP)|