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 1kXV52-0002Dy-Ic for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Oct 2020 19:56:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kXV51-00088X-HU for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Oct 2020 19:56:27 +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 1kXV51-00088P-5y for pgsql-hackers@lists.postgresql.org; Tue, 27 Oct 2020 19:56:27 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kXV4y-00014q-Kn for pgsql-hackers@postgresql.org; Tue, 27 Oct 2020 19:56:26 +0000 Received: from [192.168.1.54] (unknown [46.39.228.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id C3ECE21C424D; Tue, 27 Oct 2020 22:56:23 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1603828583; bh=5beD9uCRt42DeP6gsahWZq06052fb9NomKgFTUMsJHw=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=RtTFwt4E4hQSktpGAmPibhpI19SWYNra8vknvx1y1dlCooLdcE03VZSHUo7QSPJMb x9KSXC3Z+o9Wz1cubZyhxIrrxwVKX6CkUZLp3y/5QSgix0nX423LTESCiKMmDS5GBS zCvWlR24kEJ3iS6RtW/E7D99Omkn2j1N8b3IOMgs= Subject: Re: [patch] Fix checksum verification in base backups for zero page headers To: Michael Paquier Cc: Michael Banck , PostgreSQL Development References: <6713b5e9d98c7db1608b43cd57b10be4a08dca67.camel@credativ.de> <9489c221-e2ef-e7ad-d921-5ccad71b14de@postgrespro.ru> <423deac52479a40624e775e6d2ab41c4e9f5b19f.camel@credativ.de> <20201007081852.GC30037@paquier.xyz> <608f3476-0598-2514-2c03-e05c7d2b0cbd@postgrespro.ru> <20201020062432.GA30362@paquier.xyz> <69b38451-e91f-95fc-c3ce-06eb778d36e0@postgrespro.ru> <20201022012519.GF1475@paquier.xyz> <036235b4-2461-c4b2-a448-7875d943ce1e@postgrespro.ru> <20201022230008.GK1475@paquier.xyz> <20201026011315.GA2973@paquier.xyz> From: Anastasia Lubennikova Message-ID: Date: Tue, 27 Oct 2020 22:56:23 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201026011315.GA2973@paquier.xyz> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 26.10.2020 04:13, Michael Paquier wrote: > On Fri, Oct 23, 2020 at 08:00:08AM +0900, Michael Paquier wrote: >> Yeah, we could try to make the logic a bit more complicated like >> that. However, for any code path relying on a page read without any >> locking insurance, we cannot really have a lot of trust in any of the >> fields assigned to the page as this could just be random corruption >> garbage, and the only thing I am ready to trust here a checksum >> mismatch check, because that's the only field on the page that's >> linked to its full contents on the 8k page. This also keeps the code >> simpler. > A small update here. I have extracted the refactored part for > PageIsVerified() and committed it as that's independently useful. > This makes the patch proposed here simpler on HEAD, leading to the > attached. > -- > Michael Thank you for committing the first part. In case you need a second opinion on the remaining patch, it still looks good to me. -- Anastasia Lubennikova Postgres Professional: http://www.postgrespro.com The Russian Postgres Company