Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs
Jelte Fennema-Nio <postgres@jeltef.nl>
From: Jelte Fennema-Nio <postgres@jeltef.nl>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>,
Jacob Burroughs <jburroughs@instructure.com>, Dave Cramer <davecramer@gmail.com>, Peter Smith <smithpb2250@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, "Andrey M. Borodin" <x4mmm@yandex-team.ru>,
Pavel Stehule <pavel.stehule@gmail.com>, Jeff Davis <pgsql@j-davis.com>, Peter Eisentraut <peter@eisentraut.org>,
hlinnaka <hlinnaka@iki.fi>
Date: 2024-06-05T17:49:58Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
libpq: Add min/max_protocol_version connection options
- 285613c60a7a 18.0 landed
-
libpq: Handle NegotiateProtocolVersion message differently
- 5070349102af 18.0 landed
-
Add PQfullProtocolVersion() to surface the precise protocol version.
- cdb6b0fdb0b2 18.0 landed
-
Do not hardcode PG_PROTOCOL_LATEST in NegotiateProtocolVersion
- 516b87502dc1 18.0 landed
-
libpq: Handle NegotiateProtocolVersion message
- bbf9c282ce92 16.0 cited
-
Provide for forward compatibility with future minor protocol versions.
- ae65f6066dc3 11.0 cited
On Wed, 5 Jun 2024 at 17:12, Robert Haas <robertmhaas@gmail.com> wrote: > Well, hang on. The discussion on that thread suggests that this is > only going to break connections to servers that don't have > NegotiateProtocolVersion. Yes, correct. > What > I really don't want is for v18 to break connections to v17 servers. > That would be exponentially more disruptive. Totally agreed, and that's easily achievable because of the NegotiateProtocolVersion message. We're all good on v18 to v17 connections and protocol changes, as long as we make any new behaviour depend on either a protocol parameter or a protocol version bump. > I do take your point that poolers haven't added support for > NegotiateProtocolVersion yet, but I bet that will change pretty > quickly once there's a benefit to doing so. I think at minimum we'll need a mechanism for people to connect using a StartupMessage that doesn't break existing poolers. If users have no way to connect at all to their semi-recently installed connection pooler with the newest libpq, then I expect we'll have many unhappy users. I think it's debatable whether the compatible StartupMessage should be opt-in or opt-out. I'd personally at minimum want to wait one PG release before using the incompatible StartupMessage by default, just to give pooler installs some time to catch up. > I think it's a lot easier > for people to install a new pooler version than a new server version, > because the server has the data in it. Also, it's not like they > haven't had time. I agree that it's a lot easier to upgrade poolers than it is to upgrade PG, but still people are generally hesitant to upgrade stuff in their infrastructure. And I totally agree that poolers have had the time to implement NegotiateProtocolVersion support, but I'm pretty sure many users will assign blame to libpq anyway. > But the real question here is whether we think the longer cancel key > is really important enough to justify the partial compatibility break. > I'm not deathly opposed to it, but I think it's debatable and I'm sure > some people are going to be unhappy. I think if it's an opt-in compatibility break, users won't care how important it is. It's either important enough to opt-in to this compatibility break for them, or it's not and nothing changes for them. My feeling is that we're unlikely to find a feature that's worth breaking compatibility (with poolers and pre-9.3 PGs) by default on its own. But after adding a few new protocol features, at some point together these features become worth this break. Especially, because by then 9.3 will be even older and poolers will have started to support NegotiateProtocolVersion (due to people complaining that they cannot connect with the new opt-in libpq break-compatibility flag). But if we're going to wait until we have the one super important protocol feature, then I don't see us moving forward. To summarize: I'd like to make some relatively small opt-in change(s) in PG18 that breaks compatibility (with poolers and pre-9.3 PGs). So that when we have an important enough reason to break compatibility by default, that break will be much less painful to do.