Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f3TJ0-0001tu-1t for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Apr 2018 21:17:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f3TIy-0000iP-Me for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Apr 2018 21:17:24 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f3TIy-0000iE-Bw for pgsql-hackers@lists.postgresql.org; Tue, 03 Apr 2018 21:17:24 +0000 Received: from mail.thelabyrinth.net ([45.56.70.56]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f3TIu-0001uf-Te for pgsql-hackers@postgresql.org; Tue, 03 Apr 2018 21:17:23 +0000 Received: from Davids-MacBook.local (c-68-33-78-101.hsd1.md.comcast.net [68.33.78.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dsteele) by mail.thelabyrinth.net (Postfix) with ESMTPSA id 718D454662; Tue, 3 Apr 2018 21:17:19 +0000 (UTC) Subject: Re: pgsql: Validate page level checksums in base backups To: Michael Banck , Magnus Hagander Cc: Tom Lane , Andres Freund , PostgreSQL-development , pgsql-committers@lists.postgresql.org References: <20180403171356.v4ji5sfhbc4sggij@alap3.anarazel.de> <22322.1522780151@sss.pgh.pa.us> <20180403204815.GD20852@nighthawk.caipicrew.dd-dns.de> From: David Steele Message-ID: <115dac54-38b8-b7f8-5953-3a4a57706790@pgmasters.net> Date: Tue, 3 Apr 2018 17:17:18 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180403204815.GD20852@nighthawk.caipicrew.dd-dns.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 4/3/18 4:48 PM, Michael Banck wrote: > > Attached is a patch which does that hopefully: > > 1. creates two user tables, one large enough for at least 6 blocks > (around 360kb), the other just one block. > > 2. stops the cluster before scribbling over its data and starts it > afterwards. > > 3. uses the blocksize (and the pager header size) to determine offsets > for scribbling. This patch looks reasonable to me. > I've tested it with blocksizes 8 and 32 now, the latter should make sure > that the first table is indeed large enough, but maybe something less > arbitrary than "10000 integers" should be used? It might be quicker to just stop the cluster and then write out an arbitrary number of zero pages. Zero pages are always considered valid so you can then corrupt whichever pages you want for testing. -- -David david@pgmasters.net