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 1lZJ8t-00087a-0o for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Apr 2021 20:08:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lZJ8r-0002lh-I0 for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Apr 2021 20:08:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZJ8q-0002lZ-VU for pgsql-hackers@lists.postgresql.org; Wed, 21 Apr 2021 20:08:09 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lZJ8j-0004Hd-A8 for pgsql-hackers@postgresql.org; Wed, 21 Apr 2021 20:08:07 +0000 Received: by mail-wm1-x32e.google.com with SMTP id p10-20020a1c544a0000b02901387e17700fso1869804wmi.2 for ; Wed, 21 Apr 2021 13:08:00 -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=U+PPHYdfXQZqc4wWtu6/CwlQZCDn+hvKDH/cp0vs1ZY=; b=oYU//MPmZgqy4fZeVbZwIslcVpoSiNsuwceUZB2jXddeGhBPjlX1iMPPTkqSwihu39 OlU/LCjffDe8SlYVaecnphvCRBeblSmlIj+SS4TK7njPUJjnM13wxBl19nNVPD+gjcNx OmPdfo0/qwNNI04kPB+xlcx3bdo1Hvh2V7rv6n+SFw/SonNUSqh08+1zRO8Y7T07t3O4 UvxbNjKWUF5ypg9NFTXamLJwtjsuwZf83onKCs0L0sskwaKM5xX33/Bwj3oxSBHaPtNc PeKBPm5Jmaewcx04B3z0IPNv79YSqIkz8tKyEruTsYsz+rJEplzOx9EYsSE4NTbDqnvr q8uQ== 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=U+PPHYdfXQZqc4wWtu6/CwlQZCDn+hvKDH/cp0vs1ZY=; b=PxnVb/qfTf+5eJ3uzbyMKS7ZqrdIRbhdT01og+FTLaR0x8mSvn+dfjcz2G7KyEYuk4 8FojDTkxHMKN1pooukaS51iitsoDMEHWWSVHGQxrFrJXmZ+L+GJRQsgIUjcxUN46Z7Pb pCwC0ekHVodqrnATWR5wgh1eFzD5mFEca97K5G9B4ym6rUwNr6E7nyXKaIZsifht/GaS B1U0bVK1f8ebc+miON3sIOnOfzcAarmjBNg3z3Ko0WyzqcRmWGb9mEjYWBFbh5/LrXjt sW7aRQiP2KMkBBI5Fps9rg5mpvfoXa4HUlLQ/dW1tk6AYUnMUhpEd+W00izW6ipa9FwY 014w== X-Gm-Message-State: AOAM5325GUlAPHfSCMEpJRM4kn7nC4ScBzQi0iUODq6mTMjQJ0IHTeEy yRiLwrLcfYSytfdurhtldUJGtFASl0dqtet7+53/NQg2Qgd166OD0eCZ0KBgCy8+fByuLLobpm6 Lu3wk8adhhzWl/PmYC2n0Caz+bJQFuyMynsDuX9ZF2IdvmgzSA07nW437JdsYf5LD8kdLLDfRlW iW1S6wRlRyqvP15rYKE8Z+8CwIRwAS3lqlws1xhn0LJgMVcuNpJheSESHFKpj961N9PqaCTbXSO p/gbH8VIpRYgiK+NL+8UfLvTg8XL5/75TX77a+d X-Google-Smtp-Source: ABdhPJzyrqHRuz/tNbFRrCmUVD8gbyAYQaQQlNd7qic4epJlpq5XNwGMU+dMBeraib9mHjfY4rVfYg== X-Received: by 2002:a1c:771a:: with SMTP id t26mr11559997wmi.96.1619035678323; Wed, 21 Apr 2021 13:07:58 -0700 (PDT) Received: from [10.137.0.4] (ip-86-49-253-127.net.upcbroadband.cz. [86.49.253.127]) by smtp.gmail.com with ESMTPSA id z14sm556114wrt.54.2021.04.21.13.07.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Apr 2021 13:07:57 -0700 (PDT) Subject: Re: WIP: WAL prefetch (another approach) To: Tom Lane , Thomas Munro Cc: Stephen Frost , Andres Freund , Jakub Wartak , Alvaro Herrera , Tomas Vondra , Dmitry Dolgov <9erthalion6@gmail.com>, David Steele , pgsql-hackers References: <20210210215033.GA27507@tamriel.snowman.net> <103ec76d-8bbc-09e1-460c-8785751431b5@enterprisedb.com> <20210212044614.5wqjkjbcmbwzever@alap3.anarazel.de> <20210213213930.GM27507@tamriel.snowman.net> <20210214231815.GO27507@tamriel.snowman.net> <17b3f450-048c-f3a6-7086-259523f33cbc@enterprisedb.com> <20210317214331.GF20766@tamriel.snowman.net> <28c3352e-5388-6410-aae7-05907079e6c9@enterprisedb.com> <8dd2dcc2-0b6b-a4ab-c1b3-032c0a5ab1c3@enterprisedb.com> <773932.1619022622@sss.pgh.pa.us> From: Tomas Vondra Message-ID: Date: Wed, 21 Apr 2021 22:07:43 +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: <773932.1619022622@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 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 4/21/21 6:30 PM, Tom Lane wrote: > Thomas Munro writes: >> Yeah, it would have been nice to include that but it'll have to be for >> v15 due to lack of time to convince myself that it was correct. I do >> intend to look into more concurrency of that kind for v15. I have >> pushed these patches, updated to be disabled by default. > > I have a fairly bad feeling about these patches. I've already fixed > one critical bug (see 9e4114822), but I am still seeing random, hard > to reproduce failures in WAL replay testing. It looks like sometimes > the "decoded" version of a WAL record doesn't match what I see in > the on-disk data, which I'm having no luck tracing down. > > Another interesting failure I just came across is > > 2021-04-21 11:32:14.280 EDT [14606] LOG: incorrect resource manager data checksum in record at F/438000A4 > TRAP: FailedAssertion("state->decoding", File: "xlogreader.c", Line: 845, PID: 14606) > 2021-04-21 11:38:23.066 EDT [14603] LOG: startup process (PID 14606) was terminated by signal 6: Abort trap > > with stack trace > > #0 0x90b669f0 in kill () > #1 0x90c01bfc in abort () > #2 0x0057a6a0 in ExceptionalCondition (conditionName=, errorType=, fileName=, lineNumber=) at assert.c:69 > #3 0x000f5cf4 in XLogDecodeOneRecord (state=0x1000640, allow_oversized=1 '\001') at xlogreader.c:845 > #4 0x000f682c in XLogNextRecord (state=0x1000640, record=0xbfffba38, errormsg=0xbfffba9c) at xlogreader.c:466 > #5 0x000f695c in XLogReadRecord (state=, record=0xbfffba98, errormsg=) at xlogreader.c:352 > #6 0x000e61a0 in ReadRecord (xlogreader=0x1000640, emode=15, fetching_ckpt=0 '\0') at xlog.c:4398 > #7 0x000ea320 in StartupXLOG () at xlog.c:7567 > #8 0x00362218 in StartupProcessMain () at startup.c:244 > #9 0x000fc170 in AuxiliaryProcessMain (argc=, argv=) at bootstrap.c:447 > #10 0x0035c740 in StartChildProcess (type=StartupProcess) at postmaster.c:5439 > #11 0x00360f4c in PostmasterMain (argc=5, argv=0xa006a0) at postmaster.c:1406 > #12 0x0029737c in main (argc=, argv=) at main.c:209 > > > I am not sure whether the checksum failure itself is real or a variant > of the seeming bad-reconstruction problem, but what I'm on about right > at this moment is that the error handling logic for this case seems > quite broken. Why is a checksum failure only worthy of a LOG message? > Why is ValidXLogRecord() issuing a log message for itself, rather than > being tied into the report_invalid_record() mechanism? Why are we > evidently still trying to decode records afterwards? > Yeah, that seems suspicious. > In general, I'm not too pleased with the apparent attitude in this > thread that it's okay to push a patch that only mostly works on the > last day of the dev cycle and plan to stabilize it later. > Was there such attitude? I don't think people were arguing for pushing a patch's not working correctly. The discussion was mostly about getting it committed even and leaving some optimizations for v15. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company