Is mdextend really safe? - Mailing list pgsql-hackers

From Gregory Stark
Subject Is mdextend really safe?
Date
Msg-id 871w0kqajx.fsf@oxford.xeocode.com
Whole thread Raw
Responses Re: Is mdextend really safe?  (Florian Weimer <fweimer@bfk.de>)
Re: Is mdextend really safe?  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Re: Is mdextend really safe?  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Re: Is mdextend really safe?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Earlier we saw some bug reports from someone who had a buffer flush fail do to
ENOSPC. We asserted then that that should never happen because when we extend
the relation we write out the new blocks so any ENOSPC errors out to happen at
that point, not when a buffer is flushed.

However looking at mdextend it only writes out the requested block. Any blocks
between the end of the table and the requested block are *not* written out. We
count on the OS to implicitly fill those blocks with zeros.

On Unix that creates a sparse file where the intervening blocks are not
allocated. When we later write out those blocks the filesystem then has to
allocate space for them. IIRC the bug reports were from Windows. I'm not sure
what NTFS's behaviour with sparse files is.

Now this only matters if we ever call mdextend on a block which isn't the
block immediately following the end of file. Is that true?

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Get trained by Bruce Momjian - ask me about
EnterpriseDB'sPostgreSQL training!
 


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Patch: plan invalidation vs stored procedures
Next
From: "Pavel Stehule"
Date:
Subject: Re: proposal sql: labeled function params