Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1haqbK-00079j-Kv for pgsql-general@arkaria.postgresql.org; Tue, 11 Jun 2019 23:54:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1haqbH-0001lR-Tj for pgsql-general@arkaria.postgresql.org; Tue, 11 Jun 2019 23:54:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1haqbG-0001gR-Ng for pgsql-general@lists.postgresql.org; Tue, 11 Jun 2019 23:54:47 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1haqbD-0002tl-4k for pgsql-general@lists.postgresql.org; Tue, 11 Jun 2019 23:54:46 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id EC5BF22015; Tue, 11 Jun 2019 19:54:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 11 Jun 2019 19:54:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=n nA7HtOUV9+0KhTjd8tNT55ncE8C1OND/fceBofhfw4=; b=oKJ/jr9j7u4eqL2nr 1mp+gYkIZ04wyYiwdVfUpoumXYX1tG9F6grhDGXxSiQyyYBA2nJQHJLUyKo0HGMD ODEzDJCajoRog/fa3bK0Yw5zXqMU4P45E7IwHi03NjlAMhA7poZ5ZdQhm3YQrUzi UyKzYl0UgHCd8CKio1COFlFKaCO8Xidn63eN/xF0Il9HlY06RGatBUxw98hL8vuE qocorBtirf3GuudHHsJs8zlCVeT/TzjpGEQ3Fgyou0XZYep5lckCJl8UWcT3E8Fv TnM4xfPdlJ7kbd7ZL0bqNM3XEZ5nxtSwpgJol1yNh9vaXWbmzDzO4kc9Ss1xkaaX RmOwg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=nnA7HtOUV9+0KhTjd8tNT55ncE8C1OND/fceBofhf w4=; b=SL0wmQ6nc7oM1d1+uOsWi6fTqDyORPnhzTYF+rczFLJmRDkZ8CqvTHdq8 unsGY0SvcmnrgQyv4yGhM5itOVWwICuvo5vezoUf9ZfLdMVj80DOudpbZvGQiC2A k5xvaBFrdMQg4oV+7xRs729YWJHw3MHzXFiQJqhCBTETw7N8lZo6vmmbTSj3TXLX XsZPDeIai6sUmSY6GFHkXDZ7NzElM41alCiWAWc6N8uKEkneOlt3ICyvu1zn+QKA EINHruLgo+SaZeoCbiDWb76UlvtRuDB7+Y0lhvS5daRjEbk+dV4p8jMvEULt2QYa xgf5O8C+3pcynXhO2krn5Y3q19pzA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudehiedgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecukfhppeejuddrvddu vddrudehtddrvddtvdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklh grvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id 85054380083; Tue, 11 Jun 2019 19:54:39 -0400 (EDT) Subject: Re: Aw: Re: pg_dump include/exclude data, was: verify checksums / CREATE DATABASE To: Karsten Hilbert Cc: pgsql-general References: <20190605144737.GC16572@hermes.hilbert.loc> <20190606135037.GJ1767@hermes.hilbert.loc> <65d1d891-5063-2094-9e3b-7b0e2926f82c@aklaver.com> <20190611071546.GB2660@hermes.hilbert.loc> <084004cf-cb61-bee1-98ad-6a9e3e8e74b8@aklaver.com> From: Adrian Klaver Message-ID: <91e6acfa-3b6f-ed53-26b6-c3d6aa72c440@aklaver.com> Date: Tue, 11 Jun 2019 16:54:38 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; 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 6/11/19 11:15 AM, Karsten Hilbert wrote: >>> The problem I hope to protect against with this approach: the >>> CREATE DATABASE might untaint corrupted data from a bad disk >>> block into a good disk block virtue of doing a file level >>> copy. >>> >>> I hope my reasoning isn't going astray. >> >> As I understand it checksums are done on the page level using a hash(for >> details: https://doxygen.postgresql.org/checksum__impl_8h_source.html). >> I am not sure how a page could get un-corrupted by virtue of a file copy. > > Ah, no, I did not explain myself well. > > Let's assume a corrupted, bad (but readable at the hardware > level) disk block B. A filesystem level copy (as in CREATE > DATABASE) would successfully read that disk block B and > copy the corrupted content into a good disk block G elsewhere > on the disk. Verifying the checksum of the page sitting on > block B before doing the database cloning would > reveal the corruption before it got cloned. > > Does that make sense ? Yes. > > Karsten > -- Adrian Klaver adrian.klaver@aklaver.com