Re: WAL and commit_delay - Mailing list pgsql-hackers

From ncm@zembu.com (Nathan Myers)
Subject Re: WAL and commit_delay
Date
Msg-id 20010217150413.A16600@store.zembu.com
Whole thread Raw
In response to Re: WAL and commit_delay  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
On Sat, Feb 17, 2001 at 03:45:30PM -0500, Bruce Momjian wrote:
> > Right now the WAL preallocation code (XLogFileInit) is not good enough
> > because it does lseek to the 16MB position and then writes 1 byte there.
> > On an implementation that supports holes in files (which is most Unixen)
> > that doesn't cause physical allocation of the intervening space.  We'd
> > have to actually write zeroes into all 16MB to ensure the space is
> > allocated ... but that's just a couple more lines of code.
> 
> Are OS's smart enough to not allocate zero-written blocks?  

No, but some disks are.  Writing zeroes is a bit faster on smart disks.
This has no real implications for PG, but it is one of the reasons that 
writing zeroes doesn't really wipe a disk, for forensic purposes.

Nathan Myers
ncm@zembu.com


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: WAL and commit_delay
Next
From: "Dominic J. Eidson"
Date:
Subject: Re: WAL and commit_delay