Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lduIv-0004if-23 for pgsql-hackers@arkaria.postgresql.org; Tue, 04 May 2021 12:37:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lduIt-0006Id-75 for pgsql-hackers@arkaria.postgresql.org; Tue, 04 May 2021 12:37:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lduIt-0006IV-04 for pgsql-hackers@lists.postgresql.org; Tue, 04 May 2021 12:37:31 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lduIp-0002Ob-6O for pgsql-hackers@postgresql.org; Tue, 04 May 2021 12:37:30 +0000 Received: by mail-wr1-x42d.google.com with SMTP id a4so9255348wrr.2 for ; Tue, 04 May 2021 05:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=lPWvaRm+/dpJWBzXTt7rPFwI8LOI9Y+8eRpPMN1o3Ak=; b=ef/r+HMyeCZi+K2GPldomvXNf2tqYiTHtZQbGI3cwu0ZhLMAwaToTtT5KC7n8xwZaF HROPPTeOT79IT2faYrdtlRjUITpOU/gLVmJdeD+FHrZfe0GCCASRs/b2v2/LzkgJPshb xVULvx8EVnH/Tb2XNID5LsFC8V85z2MnMKPQcPfAk0EHTUeGUPY7Yn6BtvzVxDyaK/0r qETDJIGv0YZ0jFS0FhU7wqDKKYDPku2HrJ1jJKkjS45ibs3JfTifHmFQt2IlU7HMyZXg RfdSnYqqhnKrF0RoI+RupqjneQhDWq+PqXkU5j5OP1zU8S/eVg32XRac2E9UnwYr5fMs GxlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=lPWvaRm+/dpJWBzXTt7rPFwI8LOI9Y+8eRpPMN1o3Ak=; b=O/o0LknE2KaXCKDPaRyFvKszxW7WBrNGFGAEPdszUOhrIszrmmd00dCOTtVXu84Dbc dFKVTPdRn3n8eqHutN2hGzGie+erKJd5eSM7EW7PF9VgiAkychpWm4m71O0VLTPYdD+z UqEV2+13XDKRMUxjpJ9iUeM71aAjB1X+1Y82RSmVjI7rnOinHy3oxGlz7bpFkko8sED+ ly1eq0Yfm5mfHyjMuSBW1DN3e3VK/vOp0PHQAPtpzXtSVBukNM5CEHThVQrm40AelwBx z7AuHDd8cOvtBfAJygZT2rGZEOeDJk87sx3SBtsVjOxDDDqtc2WtHVHkO2ZmCfSk+M2W 07lw== X-Gm-Message-State: AOAM5324x/XsdUH6LLo8xnAUOi+M09mhiEElH75BNBcsln0lKiGUr8qs TY6NVxtrVsIOzQo1cCBLUKvpZEYttzKw8Co8yMD0f9pGIjtGVQIF4mlRm28+LzDWU2kSQz1hFfo KD+8l6/TqyGPX0jyWZ6bY5R7H1C7c0OhreF3geajx1CfUqpr2jtdOAHmepz6F54W0fxbNNWvEmZ 61ryg14m3a2+BWKH/0U8e8C9t8ohzgBMfqiHwMDone1lloVlIskez2FCtZaDSIDbiTtAtNudS09 YPgdJO+/G50d2fpv8WyJmls0Rjc0yEJpMxLrRpC X-Google-Smtp-Source: ABdhPJw+Hhb6otS6aeg2t4x1e2qYDsJ+i5yvJthiSLYv9CvhZhILMsrIQ3LPduCDhkQexrV6zMht6w== X-Received: by 2002:adf:e8c4:: with SMTP id k4mr32091129wrn.262.1620131844852; Tue, 04 May 2021 05:37:24 -0700 (PDT) Received: from [10.137.0.19] (ip-86-49-253-127.net.upcbroadband.cz. [86.49.253.127]) by smtp.gmail.com with ESMTPSA id f3sm16621782wrp.7.2021.05.04.05.37.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 May 2021 05:37:24 -0700 (PDT) Subject: Re: WIP: WAL prefetch (another approach) To: Thomas Munro , Tom Lane Cc: Andres Freund , Stephen Frost , Alvaro Herrera , David Steele , Dmitry Dolgov <9erthalion6@gmail.com>, Jakub Wartak , pgsql-hackers References: <8dd2dcc2-0b6b-a4ab-c1b3-032c0a5ab1c3@enterprisedb.com> <773932.1619022622@sss.pgh.pa.us> <892344.1619054465@sss.pgh.pa.us> <20210428163245.ff67pb2ii5irr5zr@alap3.anarazel.de> <2808045.1619628335@sss.pgh.pa.us> <3502526.1619925367@sss.pgh.pa.us> From: Tomas Vondra Message-ID: Date: Tue, 4 May 2021 14:37:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 5/3/21 7:42 AM, Thomas Munro wrote: > On Sun, May 2, 2021 at 3:16 PM Tom Lane wrote: >> That last point means that there was some hard-to-hit problem even >> before any of the recent WAL-related changes. However, 323cbe7c7 >> (Remove read_page callback from XLogReader) increased the failure >> rate by at least a factor of 5, and 1d257577e (Optionally prefetch >> referenced data) seems to have increased it by another factor of 4. >> But it looks like f003d9f87 (Add circular WAL decoding buffer) >> didn't materially change the failure rate. > > Oh, wow. There are several surprising results there. Thanks for > running those tests for so long so that we could see the rarest > failures. > > Even if there are somehow *two* causes of corruption, one preexisting > and one added by the refactoring or decoding patches, I'm struggling > to understand how the chance increases with 1d2575, since that only > adds code that isn't reached when not enabled (though I'm going to > re-review that). > >> Considering that 323cbe7c7 was supposed to be just refactoring, >> and 1d257577e is allegedly disabled-by-default, these are surely >> not the results I was expecting to get. > > +1 > >> It seems like it's still an open question whether all this is >> a real bug, or flaky hardware. I have seen occasional kernel >> freezeups (or so I think -- machine stops responding to keyboard >> or network input) over the past year or two, so I cannot in good >> conscience rule out the flaky-hardware theory. But it doesn't >> smell like that kind of problem to me. I think what we're looking >> at is a timing-sensitive bug that was there before (maybe long >> before?) and these commits happened to make it occur more often >> on this particular hardware. This hardware is enough unlike >> anything made in the past decade that it's not hard to credit >> that it'd show a timing problem that nobody else can reproduce. > > Hmm, yeah that does seem plausible. It would be nice to see a report > from any other system though. I'm still trying, and reviewing... > FWIW I've ran the test (make installcheck-parallel in a loop) on four different machines - two x86_64 ones, and two rpi4. The x86 boxes did ~1000 rounds each (and one of them had 5 local replicas) without any issue. The rpi4 machines did ~50 rounds each, also without failures. Obviously, it's possible there's something that neither of those (very different systems) triggers, but I'd say it might also be a hint that this really is a hw issue on the old ppc macs. Or maybe something very specific to that arch. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company