Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 9F4FDB1BBF2 for ; Fri, 6 Jan 2012 13:35:02 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RjDgy-0001TD-G0 for pgsql-hackers@postgresql.org; Fri, 06 Jan 2012 17:35:01 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q06HYi1j017743; Fri, 6 Jan 2012 12:34:44 -0500 (EST) To: Robert Haas cc: Simon Riggs , pgsql-hackers@postgresql.org Subject: Re: Poorly thought out code in vacuum In-reply-to: References: <25422.1325810273@sss.pgh.pa.us> <17477.1325870695@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Fri, 06 Jan 2012 12:30:22 -0500" Date: Fri, 06 Jan 2012 12:34:44 -0500 Message-ID: <17742.1325871284@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201201/330 X-Sequence-Number: 200923 Robert Haas writes: > On Fri, Jan 6, 2012 at 12:24 PM, Tom Lane 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