Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOtoW-0007NT-4h for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Dec 2017 23:18:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOtoV-0005W2-H9 for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Dec 2017 23:18:15 +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.84_2) (envelope-from ) id 1eOtoV-0005Vs-7E for pgsql-hackers@lists.postgresql.org; Tue, 12 Dec 2017 23:18:15 +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 1eOtoS-0006Wz-S6 for pgsql-hackers@postgresql.org; Tue, 12 Dec 2017 23:18:14 +0000 Received: from Davids-MacBook.local (c-68-33-78-252.hsd1.md.comcast.net [68.33.78.252]) (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 374F154669; Tue, 12 Dec 2017 23:18:12 +0000 (UTC) Subject: Re: PATCH: Exclude unlogged tables from base backups To: Andres Freund Cc: PostgreSQL-development References: <04791bab-cb04-ba43-e9c0-664a4c1ffb2c@pgmasters.net> <20171212225234.jqdwd4sp663l4znp@alap3.anarazel.de> <5e428ad7-f37f-6479-aabf-2c8b9318fb79@pgmasters.net> <20171212230740.evr7rvkzz5bztdg6@alap3.anarazel.de> From: David Steele Message-ID: <35ea14df-e481-34d5-b636-35038dd568a3@pgmasters.net> Date: Tue, 12 Dec 2017 18:18:09 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171212230740.evr7rvkzz5bztdg6@alap3.anarazel.de> 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 12/12/17 6:07 PM, Andres Freund wrote: >> >> I don't see this as any different than what happens during recovery. The >> unlogged forks are cleaned / re-inited before replay starts which is the >> same thing we are doing here. > > It's quite different - in the recovery case there's no other write > activity going on. But on a normally running cluster the persistence of > existing tables can get changed, and oids can get recycled. What > guarantees that between the time you checked for the init fork the table > hasn't been dropped, the oid reused and now a permanent relation is in > its place? Well, that's a good point! How about rechecking the presence of the init fork after a main/other fork has been found? Is it possible for an init fork to still be lying around after an oid has been recycled? Seems like it could be... -- -David david@pgmasters.net