Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s7z0f-008kZ3-Ft for pgsql-hackers@arkaria.postgresql.org; Fri, 17 May 2024 14:56:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s7z0e-00EbOv-Ht for pgsql-hackers@arkaria.postgresql.org; Fri, 17 May 2024 14:56:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s7z0e-00EbOn-41 for pgsql-hackers@lists.postgresql.org; Fri, 17 May 2024 14:56:36 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s7z0V-000j89-NZ for pgsql-hackers@postgresql.org; Fri, 17 May 2024 14:56:35 +0000 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1ed012c1afbso5567335ad.1 for ; Fri, 17 May 2024 07:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1715957785; x=1716562585; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=0HDfsS3ikJDHU3oPYTNBcKPQFn8I6ZedBETnIoVLfus=; b=FOBQHYNI9xcw9dzEY7Q+jQFmGK5G/84DsmBGvZVTk1Eqlk5NE4vfoqcoL+xUcGjBQJ M8kkg2ad/UVRuH3vUP9W+aYncXAABLXmjlakBdty6mJkBFJHv42vizFgPNRu69LZOQYH J3rKMXKj6HpNEFGblUh+DWohwRRePqvYGevmsy/X1ByAek7uOoiXd8Egw7z+9uChGX50 X8S2awb6/5lK8xXqbo0/jXqqHNFisMBDLLOTdgxI3zUzrXqXHlK5bdkw9xOTUfAYoh1x 2fT8gGZCPVx7kCZ2efEyWrWBPrLDfX/fXoR3L+EOGMV73MgNwp7sjFVNygEBPmxXz97p PO+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715957785; x=1716562585; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=0HDfsS3ikJDHU3oPYTNBcKPQFn8I6ZedBETnIoVLfus=; b=tiJwkoC0VnjoN4aaif33+X+kIz9yY21tpQzEI3NczoJLOuQAz6eZg7BoBqgM+rINqI 4P+/8uSO+G0vJ4wR64dl0aiTup+qvX0NNQyZgXqQGGE6FKZTzN7OD3xZkNf8eEuWkkwO lk8oB3vUZFB8C3L8fZPwY1ijWXZ4nawIDhOJlbBRWwxWTyJ/tJhumrarzu6dfu+UJvM3 C5WHYRiTq3G0es5NoYPLKKwLAFR0RO5gGHp5qG+iuW5QLtqiOr1fHxOl1kUv1ZC6FAIf bSIB0TKl1lAD5Mxp12KK0B/ci86HcJXYPtJ84QpCBPcm6lcxJ03YZu1hNkOXtSaVg7Sc fcog== X-Forwarded-Encrypted: i=1; AJvYcCWvcY0lBY4p+WZJaibpmFhmE/cuKFCNJ4Kfax24jtzowIPf0cggWGgmOObHl0Lsh3xIoECJ2hq2ivR9sNAv6/rzNna2p8q8Xa2INEyf X-Gm-Message-State: AOJu0Yz/4btfHff+b2qj4d362/yz7YNv1NI8OlNgXlGbU3Z9SbJbcn3h 5NTtDCHvSTCmdhxySEw4QjPoRYpGNRmKgJfe/uh97qmKK55BZgcfdyVFvEtUgA== X-Google-Smtp-Source: AGHT+IHBK8lj0sOEZWXaIlsgjP+MLRxlcxGEdiELJzEMoYh3QBJfJzBcRu/FXr60rQH83yI61X0r9g== X-Received: by 2002:a17:903:2282:b0:1f0:8cbf:c1b5 with SMTP id d9443c01a7336-1f08cbfcffamr147569405ad.16.1715957785538; Fri, 17 May 2024 07:56:25 -0700 (PDT) Received: from jeff-laptop.lan (c-76-102-242-158.hsd1.ca.comcast.net. [76.102.242.158]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0c037520sm158167355ad.194.2024.05.17.07.56.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 07:56:25 -0700 (PDT) Message-ID: Subject: Re: WAL record CRC calculated incorrectly because of underlying buffer modification From: Jeff Davis To: Michael Paquier Cc: Thomas Munro , Alexander Lakhin , Andres Freund , pgsql-hackers , Amit Kapila , Heikki Linnakangas Date: Fri, 17 May 2024 07:56:23 -0700 In-Reply-To: References: <055bb33c-bccc-bc1d-c2f8-8598534448ac@gmail.com> <20240510155742.sznwmnmllsewjsbc@awork3.anarazel.de> <0a2e14d3-fbc8-9e86-a968-e0c4a465e5b0@gmail.com> <35e2c2f8-f65a-f93a-ea23-957bb67a2d42@gmail.com> <895723aba95f108207a744c799588ec3f2fef819.camel@j-davis.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2024-05-17 at 10:12 +0900, Michael Paquier wrote: > That's something I've done four weeks ago in the hash replay code > path, and having the image with XLR_CHECK_CONSISTENCY even if > REGBUF_NO_CHANGE was necessary because replay was setting up a LSN on > a REGBUF_NO_CHANGE page it should not have touched. Then the candidate fix to selectively break XLR_CHECK_CONSISTENCY is not acceptable. >=20 > Yeah, agreed that getting rid of REGBUF_NO_CHANGE would be nice in > the > final picture.=C2=A0 It still strikes me as a weird concept that WAL > replay > for hash indexes logs full pages just to be able to lock them at > replay based on what's in the records.=C2=A0 :/ I'm still not entirely clear on why hash indexes can't just follow the rules and exclusive lock the buffer and dirty it. Presumably performance would suffer, but I asked that question previously and didn't get an answer: https://www.postgresql.org/message-id/CA%2BTgmoY%2BdagCyrMKau7UQeQU6w4LuVEu= %2ByjsmJBoXKAo6XbUUA%40mail.gmail.com And if that does affect performance, what about following the same protocol as XLogSaveBufferForHint()? Regards, Jeff Davis