Re: double writes using "double-write buffer" approach [WIP]

Greg Smith <greg@2ndquadrant.com>

From: Greg Smith <greg@2ndQuadrant.com>
To: pgsql-hackers@postgresql.org
Date: 2012-02-07T17:04:52Z
Lists: pgsql-hackers
On 02/07/2012 12:09 AM, Dan Scales wrote:
> So, yes, good point -- double writes cannot replace the functionality of full_page_writes for base backup.  If double writes were in use, they might be automatically switched over to full page writes for the duration of the base backup.  And the double write file should not be part of the base backup.

There is already a check for this sort of problem during the base 
backup.  It forces full_pages_writes on for the backup, even if the 
running configuration has it off.  So long as double writes can be 
smoothly turned off and back on again, that same section of code can 
easily be made to handle that, too.

As far as not making the double write file part of the base backup, I 
was assuming that would go into a subdirectory under pg_xlog by 
default.  I would think that people who relocate pg_xlog using one of 
the methods for doing that would want the double write buffer to move as 
well.  And if it's inside pg_xlog, existing base backup scripts won't 
need to be changed--the correct ones already exclude pg_xlog files.

-- 
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com