Re: Poorly thought out code in vacuum

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Poorly thought out code in vacuum
Date: 2012-01-06 17:34:44
Message-ID: 17742.1325871284@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Fri, Jan 6, 2012 at 12:24 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> So at this point I've got serious doubts as to the quality of testing of
>> that whole patch, not just this part.

> I tested the case where we skip a block during the first pass, but I
> admit that I punted on testing the case where we skip a block during
> the second pass, because I couldn't think of a good way to exercise
> it. Any suggestions?

Hack ConditionalLockBufferForCleanup to have a 50% probability of
failure regardless of anything else, for instance via

static int ctr = 0;

if ((++ctr) % 2)
return false;

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2012-01-06 17:40:46 Re: pgsphere
Previous Message Dave Cramer 2012-01-06 17:32:54 pgsphere