Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbk09-0002WE-CN for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Apr 2022 14:17:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nbk08-00048Y-8c for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Apr 2022 14:17:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbk07-00048P-Vv for pgsql-hackers@lists.postgresql.org; Tue, 05 Apr 2022 14:17:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbk05-0000fh-Pn for pgsql-hackers@postgresql.org; Tue, 05 Apr 2022 14:17:42 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 235EHdJs2358497; Tue, 5 Apr 2022 10:17:39 -0400 From: Tom Lane To: Robert Haas cc: Markus Wanner , "pgsql-hackers@postgresql.org" , Kyotaro Horiguchi Subject: Re: API stability [was: pgsql: Fix possible recovery trouble if TRUNCATE overlaps a checkpoint.] In-reply-to: References: Comments: In-reply-to Robert Haas message dated "Tue, 05 Apr 2022 10:01:56 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2358495.1649168259.1@sss.pgh.pa.us> Date: Tue, 05 Apr 2022 10:17:39 -0400 Message-ID: <2358496.1649168259@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > On Tue, Apr 5, 2022 at 9:02 AM Markus Wanner > wrote: >> And for this specific case: Is it worth reverting this change and >> applying a fully backwards compatible fix, instead? > I think it's normally our policy to avoid changing definitions of > accessible structs in back branches, except that we allow ourselves > the indulgence of adding new members at the end or in padding space. > So what would probably be best is if, in the back-branches, we changed > "delayChkpt" back to a boolean, renamed it to delayChkptStart, and > added a separate Boolean called delayChkptEnd. Maybe that could be > added just after statusFlags, where I think it would fall into padding > space. Renaming it would constitute an API break, which is if anything worse than an ABI break. While we're complaining at you, let me point out that changing a field's content and semantics while not changing its name is a time bomb waiting to break any third-party code that looks at (or modifies...) the field. What I think you need to do is: 1. In the back branches, revert delayChkpt to its previous type and semantics. Squeeze a separate delayChkptEnd bool in somewhere (you can't change the struct size either ...). 2. In HEAD, rename the field to something like delayChkptFlags, to ensure that any code touching it has to be inspected and updated. In other words, this is already an API break in HEAD, and that's fine, but it didn't break it hard enough to draw anyone's attention, which is not fine. regards, tom lane