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 1kLSAl-0002D9-RJ for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Sep 2020 14:24:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kLSAk-0006fd-Ny for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Sep 2020 14:24:34 +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 1kLSAk-0006fW-Do for pgsql-hackers@lists.postgresql.org; Thu, 24 Sep 2020 14:24:34 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kLSAh-0005MC-Lc for pgsql-hackers@postgresql.org; Thu, 24 Sep 2020 14:24:34 +0000 Received: from [172.20.10.4] (unknown [213.87.160.98]) (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 E1BAD21C3772; Thu, 24 Sep 2020 17:24:29 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1600957470; bh=m8syxOAHxcldKR3ugM5LPhGz+v/eZ2CLo/hjdOOndVg=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=bs9eAerSgp1dfFvUY72jiPsPg7G4cF/gwcm1PpquiQSF/xC7asoGxoqJBfF9+3Zjg UEjA20dzcdr3xDAAOw2lJnBd6mAWQEVA102kMZ6XX5v0BrtCYWyNdZ5oEZ69uH1sLP 2sf5RKQwgLlgTpGSwG91MrFibUq8dBkLb7RxvJ/A= Subject: Re: [patch] Fix checksum verification in base backups for zero page headers To: Michael Banck Cc: PostgreSQL Development References: <2439c2d6cee13d611e23ba651e5eb4ab0469bf99.camel@credativ.de> <4b1c16216dcb60e1dad96142d25fd06fb77485bf.camel@credativ.de> <6713b5e9d98c7db1608b43cd57b10be4a08dca67.camel@credativ.de> From: Anastasia Lubennikova Message-ID: <9489c221-e2ef-e7ad-d921-5ccad71b14de@postgrespro.ru> Date: Thu, 24 Sep 2020 17:24:27 +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: <6713b5e9d98c7db1608b43cd57b10be4a08dca67.camel@credativ.de> Content-Type: text/plain; charset=utf-8; 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 22.09.2020 17:30, Michael Banck wrote: > Hi, > > Am Dienstag, den 22.09.2020, 16:26 +0200 schrieb Michael Banck: >> Am Mittwoch, den 02.09.2020, 16:50 +0300 schrieb Anastasia Lubennikova: >>> I've looked through the previous discussion. As far as I got it, most of >>> the controversy was about online checksums improvements. >>> >>> The warning about pd_upper inconsistency that you've added is a good >>> addition. The patch is a bit messy, though, because a huge code block >>> was shifted. >>> >>> Will it be different, if you just leave >>> "if (!PageIsNew(page) && PageGetLSN(page) < startptr)" >>> block as it was, and add >>> "else if (PageIsNew(page) && !PageIsZero(page))" ? >> Thanks, that does indeed look better as a patch and I think it's fine >> as-is for the code as well, I've attached a v2. > Sorry, forgot to add you as reviewer in the proposed commit message, > I've fixed that up now in V3. > > > Michael > Great. This version looks good to me. Thank you for answering my questions, I agree, that we can work on them in separate threads. So I mark this one as ReadyForCommitter. The only minor problem is a typo (?) in the proposed commit message. "If a page is all zero, consider that a checksum failure." It should be "If a page is NOT all zero...". -- Anastasia Lubennikova Postgres Professional: http://www.postgrespro.com The Russian Postgres Company