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 1gDiuk-0000zK-Pu for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Oct 2018 04:31:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gDiui-0003Ed-AZ for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Oct 2018 04:31:00 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1gDiui-0003EW-3F for pgsql-hackers@lists.postgresql.org; Sat, 20 Oct 2018 04:31:00 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gDiuf-0002Ar-Kn for pgsql-hackers@postgresql.org; Sat, 20 Oct 2018 04:30:59 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 7EF59C30; Sat, 20 Oct 2018 00:30:54 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 20 Oct 2018 00:30:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=cRdzV5UwFwEtQsY6w05EVzkoMMH j5Zalui21RXlP1OM=; b=A3667g91hMPTrHD+B0qOq+Eo4+aAqFgvXG/0JFpoGa9 MKPeTjnYkMkPMiS5+O3ly4G+1/0AeZoN0hDsTYFWCAfZVbKUIjtyOWrdt+eBMCWj SDXPiHaMkw9IXqPQUB94hwQJMuMsGk/QVrNmA25oIf6Hgpq3vvb2PuJ/S7+VF01s vR+skPlOO9d0eHTpce/NgurORLE+1Kkhoqp7ADr2tuOyREeGmZSQdBt+MNxyugdK vmvDc2yLBpQJFs7qzUICzAGv31BLLQi8iliiLXfvNA+TxGvGSbFJtb8wzQOz64kQ cHCPveNCwlEImKY25J6BzkBFv7iid+qnjChIOWFwq8Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm1; bh=cRdzV5 UwFwEtQsY6w05EVzkoMMHj5Zalui21RXlP1OM=; b=D6m0zkVS9IextwIr/t7sXI 0tqW03zHwikvhSqOV6cXohd1LyXOy7hgQvhQTZdes1jRXvO094CDN/gqpOCous6F svVVQ59wHXKm592A1iibjPglO8VH/lqLOWfZbZ0SbSz135HLosOLfrtRwaVrkxFq ofCorTUPerzAZyd/MBTozSlCEZ3bmcvI1Xczv5Jft+VjnUDWxoxcG24Tt0JUax8D ckUYIcO1MUUfeT1jVA7BGF7FbrnUS7Et9hP+czhC+7x+btIisgpanlD1yIl3wq88 4lz2qzNK+kJGa2A50bNjWGBoU6tOHPQOOGzTrDqrb9nO4pPCCOp61LsKu3hBEAQg == X-ME-Sender: X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 2CB68102DD; Sat, 20 Oct 2018 00:30:48 -0400 (EDT) Date: Sat, 20 Oct 2018 13:30:46 +0900 From: Michael Paquier To: Andres Freund Cc: Tom Lane , Andrew Dunstan , Stephen Frost , Michael Banck , Postgres hackers , Daniel Gustafsson , Magnus Hagander Subject: Re: pgsql: Add TAP tests for pg_verify_checksums Message-ID: <20181020043046.GC2553@paquier.xyz> References: <20181019192146.j4my7yjzv4eitw2w@alap3.anarazel.de> <20181019195728.GQ4184@tamriel.snowman.net> <20181019200723.4byzaw5km5jvsxlc@alap3.anarazel.de> <20181019203546.GR4184@tamriel.snowman.net> <20181019205724.ewnuhvrsanacihzq@alap3.anarazel.de> <20181019213257.GS4184@tamriel.snowman.net> <16306.1539988998@sss.pgh.pa.us> <20181020033955.GA2553@paquier.xyz> <20181020035004.7brmu7pkajlbdsp5@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4ZLFUWh1odzi/v6L" Content-Disposition: inline In-Reply-To: <20181020035004.7brmu7pkajlbdsp5@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --4ZLFUWh1odzi/v6L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 19, 2018 at 08:50:04PM -0700, Andres Freund wrote: > On 2018-10-20 12:39:55 +0900, Michael Paquier wrote: >> So what I think we ought to do is the following: >> - Start a new thread, this one about TAP tests is not adapted. >> - Add in src/common/relpath.c the API from d55241af called >> isRelFileName(), make use of it in the base backup code, and basically >> remove is_checksummed_file() and the checksum skip list. >=20 > I think it probably shouldn't quite be that as an API. The code should > not just check whether the file matches a pattern, but also importantly > needs to exclude files that are in a temp tablespace. isRelFileName() > doesn't quite describe an API meaning that. I assume we should keep > something like isRelFileName() but use an API ontop of that that also > exclude temp files / relations. =46rom what I can see we would need to check for a couple of patterns if we go to this extent: - Look for PG_TEMP_FILE_PREFIX and exclude those. - looks_like_temp_rel_name() which checks for temp files names. This is similar to isRelFileName except that it works on temporary files. Moving it to relpath.c and renaming it IsTempRelFileName is an idea. But this one would not be necessary as isRelFileName discards temporary relations, no? - parse_filename_for_nontemp_relation() is also too similar to isRelFileName(). At the end, do we really need to do anything more than adding some checks on PG_TEMP_FILE_PREFIX? I am not sure that there is much need for a global API like isChecksummedFile for only those two places. I have already a patch doing the work of moving isRelFileName() into src/common/. Adding one check on PG_TEMP_FILE_PREFIX is not much work on top of it. -- Michael --4ZLFUWh1odzi/v6L Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlvKr3YACgkQnvQgOdby QH1TbQ/+MomP98SK6rc9wsROP95/CgWr1U6LUR9XAPIogdEo6JPnLNKTWD/0Cwyz ZX/HtMFOTeWPHMiTNXQDPg6tYrGAlsyTZ6M44SFnvpbMcEhQOzMv7+q/kndI9THS WYw2MAsLknmNb7MEB8D9ckHHU05qMVwEK6kAptVs6Rl/SieLRoONAndHFsIYpDvu cuv1wkEYBeIqTtp2jgAxCBS9q5VG6eCAp7Rqdt1N5QwObOCjLJTaak14P4Yym8ul dLAFOzGC/hXWgrBhH9ibnFB9IP9TkpCT7oYxrr17j7hVPsmyZ34QPmsBxaXfGzZX +jB4Lo4uOSIiQK1ids2Kh5ZC78fZawjvYkfBEj5j66f4+YClfsRbCgOxb3rAIuql 5YDeVEpVGh2CgGF1h9bNC26h3/eLbKytEXcfBUk/IYRgEOiWqNTul7Vwi2AbvqDo BEM2At/uK6e2QPLQ2XTAv7ydAfqpBsEJuCZjjrIQWYdJ8XLjntUUdsR2TwEhSG5M 0w5i3FrYQfScpWwdLvPGvf9yrLOPWq8tHArqd0QOnllT97xUo0mIM/fn+N5UD8EO EInGFn3tKm90xV+cCrtM3uY7gC7JD5D8viLQRhisqesQAsL574Vx+Fb4wpH6e6xj TCg4ndmgm17/HmtpFVcPvauruKF38qBq9R4fdcBLmjaroO98LIg= =hLM7 -----END PGP SIGNATURE----- --4ZLFUWh1odzi/v6L--