Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ej5kT-0002iO-RY for pgsql-committers@arkaria.postgresql.org; Tue, 06 Feb 2018 16:05:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ej5kS-0006y0-RC for pgsql-committers@arkaria.postgresql.org; Tue, 06 Feb 2018 16:05:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ej5kS-0006xF-MN for pgsql-committers@lists.postgresql.org; Tue, 06 Feb 2018 16:05:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ej5kM-00061w-5v for pgsql-committers@postgresql.org; Tue, 06 Feb 2018 16:05:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w16G5MXg015463; Tue, 6 Feb 2018 11:05:22 -0500 From: Tom Lane To: Robert Haas cc: Andres Freund , Peter Geoghegan , Rushabh Lathia , pgsql-committers Subject: Re: pgsql: Support parallel btree index builds. In-reply-to: References: <20180204174241.ca4n5x6xxjhc4rfa@alap3.anarazel.de> <18025.1517767905@sss.pgh.pa.us> <6370.1517931972@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Tue, 06 Feb 2018 10:59:56 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15461.1517933121.1@sss.pgh.pa.us> Date: Tue, 06 Feb 2018 11:05:21 -0500 Message-ID: <15462.1517933121@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > On Tue, Feb 6, 2018 at 10:46 AM, Tom Lane wrote: >> ... I, at least, don't have that understanding from looking >> at the thread. For one thing, Peter has not explained why this issue >> appears now with parallel index build when it did not before; it's >> not like logtape.c isn't old enough to vote. > Yeah, he has actually. In other cases, the buffer is guaranteed to > have been filled at least once (and thus, from valgrind's point of > view, is initialized) because if that weren't going to happen then we > would have not have switched to a tape-sort in the first place. You > can't set work_mem smaller than 8kB. But in the parallel case each > worker must always produce a tape, so it can happen if a worker is > unlucky enough to get only a very small slice of the data (because the > other participants gobble it all up before that process really gets > going). Ah, I see. So this is really a problem that's been latent all along, but was never exposed in any previous use-case for logtape.c. > But what I really need here is > some input on an option you do like, not just a list of things you > don't like. I like the option of doing VALGRIND_MAKE_MEM_DEFINED on the tail portion of the buffer before writing it. That seems pretty tightly tied to the behavior we're decreeing valid, whereas the suppression is not. regards, tom lane