Re: WAL and commit_delay

From: Larry Rosenman <ler(at)lerctr(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, vadim4o(at)email(dot)com
Subject: Re: WAL and commit_delay
Date: 2001-02-17 20:52:20
Message-ID: 20010217145220.A2549@lerami.lerctr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> [010217 14:50]:
> > * Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> [010217 14:46]:
> > > > 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? Do we need
> > > to write non-zeros?
> > I don't believe so. writing Zeros is valid.
>
> The reason I ask is because I know you get zeros when trying to read
> data from a file with holes, so it seems some OS could actually drop
> those blocks from storage.
I've written swap files and such with:

dd if=/dev/zero of=SWAPFILE bs=512 count=204800

and all the blocks are allocated.

LER

>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
> + If your life is a hard drive, | 830 Blythe Avenue
> + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-02-17 22:56:19 Re: WAL and commit_delay
Previous Message Bruce Momjian 2001-02-17 20:50:49 Re: WAL and commit_delay