From: Simon Riggs <simon@2ndquadrant.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
To: List pgsql-patches <pgsql-patches@postgresql.org>
Subject: Re: [HACKERS] Hint Bits and Write I/O
Date: Wed, 18 Jun 2008 23:41:05 +0100
Message-ID: <1213828865.9468.177.camel@ebony.site> (raw)
In-Reply-To: <1213797209.9468.126.camel@ebony.site>
References: <1211916951.4489.232.camel@ebony.site>
<15901.1211931165@sss.pgh.pa.us>
<1213797209.9468.126.camel@ebony.site>
On Wed, 2008-06-18 at 14:53 +0100, Simon Riggs wrote:
> There is one minor strangeness in the patch, which is the change of
> initdb's command order when "vacuuming database template1". With the
> previous ordering of ANALYZE; VACUUM FULL; VACUUM; the flexible hint bit
> setting of the ANALYZE on a freshly bootstrapped database caused a
> *consistent* error during the VACUUM FULL which follows it. That took,
> (cough, splutter), a little while to resolve. I've added that as a test
> to the vacuum regression tests and not found another error (yet?). An
> interesting mystery though. :-)
Ah! Now I understand.
The ANALYZE was setting hint bits, yet not dirtying the buffer. When the
VACUUM reads the buffer it sees the hint bits set, so doesn't set the
buffer dirty. Yet if the buffer is replaced the hints are lost, yet the
VACUUM now relies upon their presence - wham!
So, for this to work VACUUM correctly must dirty any buffer it touches
that has hint_count > 0, even if no hints were set by the VACUUM. VACUUM
will then act the same, no matter whether another session has recently
touched the buffer. Conceivably, this might mean that VACUUM dirties
*more* buffers than it did before, but at least it will write them also.
New version on its way.
--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-patches@postgresql.org
Cc: simon@2ndquadrant.com, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Hint Bits and Write I/O
In-Reply-To: <1213828865.9468.177.camel@ebony.site>
References: <1211916951.4489.232.camel@ebony.site> <15901.1211931165@sss.pgh.pa.us> <1213797209.9468.126.camel@ebony.site> <1213828865.9468.177.camel@ebony.site>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox