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
In response to
pgsql-hackers by date
|Next:||From: Alvaro Herrera||Date: 2008-06-18 23:16:41|
|Subject: ecpg generated files ignorable?|
|Previous:||From: Josh Berkus||Date: 2008-06-18 22:31:55|
|Subject: Re: regex cache|
pgsql-patches by date
|Next:||From: Tom Lane||Date: 2008-06-19 02:37:19|
|Subject: Re: Rewrite sinval messaging to reduce contention |
|Previous:||From: Bruce Momjian||Date: 2008-06-18 18:43:42|
|Subject: Re: Simplify formatting.c|