Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtYXK-00Csvz-OQ for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Oct 2023 19:18:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qtYXI-006FEz-6x for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Oct 2023 19:18:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtYXH-006FEr-TQ for pgsql-hackers@lists.postgresql.org; Thu, 19 Oct 2023 19:18:24 +0000 Received: from mail.thelabyrinth.net ([45.56.70.56]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtYXF-001Iwr-V3 for pgsql-hackers@postgresql.org; Thu, 19 Oct 2023 19:18:23 +0000 Received: from [10.51.120.26] (pool-71-178-230-164.washdc.fios.verizon.net [71.178.230.164]) (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 B63AC5467B; Thu, 19 Oct 2023 19:18:20 +0000 (UTC) Message-ID: <937634ae-e562-690a-8a5e-a964ba39f188@pgmasters.net> Date: Thu, 19 Oct 2023 15:18:20 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: trying again to get incremental backup To: Robert Haas , Dilip Kumar Cc: Andres Freund , "pgsql-hackers@postgresql.org" References: <20230614194717.jyuw3okxup4cvtbt@awork3.anarazel.de> <20230614204056.bhjq6hozxkjtbz7s@awork3.anarazel.de> <20230619155151.grygznxxnazgu6qm@awork3.anarazel.de> Content-Language: en-US From: David Steele In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/19/23 12:05, Robert Haas wrote: > On Wed, Oct 4, 2023 at 4:08 PM Robert Haas wrote: >> Clearly there's a good amount of stuff to sort out here, but we've >> still got quite a bit of time left before feature freeze so I'd like >> to have a go at it. Please let me know your thoughts, if you have any. > > Apparently, nobody has any thoughts, but here's an updated patch set > anyway. The main change, other than rebasing, is that I did a bunch > more documentation work on the main patch (0005). I'm much happier > with it now, although I expect it may need more adjustments here and > there as outstanding design questions get settled. > > After some thought, I think that it should be fine to commit 0001 and > 0002 as independent refactoring patches, and I plan to go ahead and do > that pretty soon unless somebody objects. 0001 looks pretty good to me. The only thing I find a little troublesome is the repeated construction of file names with/without segment numbers in ResetUnloggedRelationsInDbspaceDir(), .e.g.: + if (segno == 0) + snprintf(dstpath, sizeof(dstpath), "%s/%u", + dbspacedirname, relNumber); + else + snprintf(dstpath, sizeof(dstpath), "%s/%u.%u", + dbspacedirname, relNumber, segno); If this happened three times I'd definitely want a helper function, but even with two I think it would be a bit nicer. 0002 is definitely a good idea. FWIW pgBackRest does this conversion but also errors if it does not succeed. We have never seen a report of this error happening in the wild, so I think it must be pretty rare if it does happen. Regards, -David