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 1gDj03-0001Bd-Un for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Oct 2018 04:36:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gDj00-0005Gt-DM for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Oct 2018 04:36:28 +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 1gDj00-0005Gm-67 for pgsql-hackers@lists.postgresql.org; Sat, 20 Oct 2018 04:36:28 +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 1gDizy-0002Ho-3u for pgsql-hackers@postgresql.org; Sat, 20 Oct 2018 04:36:27 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 98152C9A; Sat, 20 Oct 2018 00:36:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sat, 20 Oct 2018 00:36:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=2c0QlR5CGJC+cFq5Z4qdgJi14TQ a2Q/ihMLfz4g5Ea0=; b=xX2PKPS6DiCeuBP3qQkiq4Yeigp37BmcHDEJUMe44zd hdy1tb6rh9kgAYbiUFxZCIvKwrERo52T6sfWMGPKp9QSJfNg6FicePGaqrCcOz3O 1HOYc5lDcEHheYBat6kdAYXjjo1zbuyA0hCcr46E4qJWECdhSDC9YIpSB2E+OpJA h9cEdf9L21OJbwns+YRjAVk/a98KDfrRcyqRpPtaDPThJdgF0RRZfAa2UqF/fE8q tlSUzeGU1U5H5dZYyOPmXV7uwvnvZL+Q2SdTpJqwXbnrYf1SuUq3wuwqBM69Zl5H OGn144AHUXRwgUeP2syxOleLlc1KTlvYFJsf7O72y6A== 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=2c0QlR 5CGJC+cFq5Z4qdgJi14TQa2Q/ihMLfz4g5Ea0=; b=j4K/nxTTMcxac9+BxJsNU3 U2FQP6MBIXbB+DAngZjYS+DdOIKbDYQCzQtWivGZzGdKWqvQ5mi6TZfxDNc1mr2w UYAg6S/ATCY3zPPTEPa4mYshP8ORHrEEaG5cyjH978lJt/8GAyb7mkspgx6lnjqx 3ElqQtYmFk0kphSwdYKqJMPEt+pUWBvBIPLqn1ZWmNPvpiN1DQIS116ilCZXYFGj vzmlK9ba27tb2XWsVL00cG/OHD83EXDT9nA5+ksv9jQIHRWZLX99RTs4DwqH/TJk u0WtKC0GafhWmbwbDxKwhLY/Iv1W7bp2vht7d00xI0OYCcCkOlMbF3LQZ29x03BQ == X-ME-Sender: X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id E7CD0E447F; Sat, 20 Oct 2018 00:36:20 -0400 (EDT) Date: Fri, 19 Oct 2018 21:36:18 -0700 From: Andres Freund To: Michael Paquier 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: <20181020043618.q7ruueb3vr27skia@alap3.anarazel.de> References: <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> <20181020043046.GC2553@paquier.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181020043046.GC2553@paquier.xyz> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2018-10-20 13:30:46 +0900, Michael Paquier wrote: > 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. > > > > 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. > > From 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? I think it's not good to have those necessary intermingled in an exposed function. > At the end, do we really need to do anything more than adding some > checks on PG_TEMP_FILE_PREFIX? I think we also need the exclusion list basebackup.c has that generally skips files. They might be excluded anyway, but I think it'd be safer to make sure. > I am not sure that there is much need for a global API like > isChecksummedFile for only those two places. Seems likely that other tools would want to have access too. Greetings, Andres Freund