Re: API stability [was: pgsql: Fix possible recovery trouble if TRUNCATE overlaps a checkpoint.]
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Markus Wanner <markus.wanner@enterprisedb.com>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>,
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Date: 2022-04-05T14:17:39Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes: > On Tue, Apr 5, 2022 at 9:02 AM Markus Wanner > <markus.wanner@enterprisedb.com> 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
Commits
-
Rethink the delay-checkpoint-end mechanism in the back-branches.
- 48b398943b78 10.21 landed
- 6270ee445040 11.16 landed
- 68e605b9ef37 12.11 landed
- d18c913b786c 13.7 landed
- 10520f434687 14.3 landed
-
Rename delayChkpt to delayChkptFlags.
- f37015a1617d 15.0 landed
-
Fix possible recovery trouble if TRUNCATE overlaps a checkpoint.
- bbace5697df1 14.3 cited