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: Jacob Champion <jacob.champion@enterprisedb.com>,
Heikki Linnakangas <hlinnaka@iki.fi>, 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>, Daniele Varrazzo <daniele.varrazzo@gmail.com>
Date: 2024-12-23T17:46:16Z
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
Attachments
- v16-0001-libpq-Add-PQfullProtocolVersion-to-exports.txt.patch (application/octet-stream) patch v16-0001
- v16-0002-libpq-Trace-NegotiateProtocolVersion-correctly.patch (application/octet-stream) patch v16-0002
- v16-0003-libpq-Handle-NegotiateProtocolVersion-message-di.patch (application/octet-stream) patch v16-0003
- v16-0004-libpq-Add-min-max_protocol_version-connection-op.patch (application/octet-stream) patch v16-0004
- v16-0005-Use-latest-protocol-version-in-libpq_pipeline-te.patch (application/octet-stream) patch v16-0005
- v16-0006-Bump-protocol-version-to-3.2.patch (application/octet-stream) patch v16-0006
- v16-0007-Add-infrastructure-for-protocol-parameters.patch (application/octet-stream) patch v16-0007
- v16-0008-Add-report_parameters-protocol-parameter.patch (application/octet-stream) patch v16-0008
On Mon, 9 Sept 2024 at 17:57, Robert Haas <robertmhaas@gmail.com> wrote: > > On Mon, Aug 26, 2024 at 8:40 AM Robert Haas <robertmhaas@gmail.com> wrote: > > On Fri, Aug 23, 2024 at 3:40 PM Jacob Champion > > <jacob.champion@enterprisedb.com> wrote: > > > Agreed on the name. I've attached a reconfigured version of v15-0003, > > > with an extension that should hopefully not throw off the cfbot, and a > > > commit message that should hopefully not misrepresent the discussion > > > so far? > > > > LGTM. Objections? > > Hearing none, committed. Sorry for the radio silence here, but I thought I'd pick this thread up again. Attached is an updated version of the patchset. 1. Fixes a small, but important oversight in cdb6b0fdb0b 2. The fix for tracing logic, which I originally tried to get committed in another thread[1], but Alvaro suggested I move it back here. 3. Making pqGetNegotiateProtocolVersion3 less strict 4. Adds min_protocol_version and max_protocol_version. This patchset did not have min_protocol_version before, but given that some new protocol features might improve security it makes sense to allow people to configure a lower limit. 5. Unchanged from previous patchset versions 6. Bumps the version and was changed to also introduce tests, which add coverage for PQfullProtocolVersion and max_protocol_version (min_protocol_version isn't testable unless connecting against an older PG server) 7 & 8. Unchanged from previous versions I think 1 & 2 should hopefully be no-brainers. 3 doesn't do anything too special imo, but maybe requires some bikeshedding on the error messages or something. 4 is a user facing API, so probably some discussion is needed. In another thread it was suggested to use a single connection option that allowed version ranges[2]. I don't feel super strong either way, but I prefer these two separate options. It matches well with the ssl_min_protocol_version/ssl_max_protocol_version options that we already have. It also makes sure we don't need to introduce the complexity to allow for the parsing, documenting and handling of such version ranges. E.g. if we would to support both > and >= in such version ranges then, we'd need to store both a version number and an operation. And finally having separate min and max options nudges people to use them sensibly, because we don't want people to accidentally disable support for protocol versions, and by having protocol_version=3.2 mean ONLY 3.2 that's probably what will happen because that looks much more natural than protocol_version=>=3.2 5 might be debatable if we want to do that. 6 It only makes sense to bump the protocol version in a PG release if there's also some changes to the protocol. But I agree with Heikki that it's problematic that not all poolers support sending the ProtocolVersionNegotiation message. Having libpq request a new protocol version by default is probably the best way of nudging those maintainers to implement support for it. So I think we could even consider merging this without any protocol changes. This all with the intent of reverting the commit before the actual release, if we don't also merge a protocol change. If we do this we'd also want to temporarily set the default max_protocol_version to "latest", to actually request the new protocol version. 7 & 8 should probably be ignored for now, because I think I haven't addressed all previous feedback on those yet. [1]: https://www.postgresql.org/message-id/202408160005.k6pafpzuz5dl%40alvherre.pgsql [2]: https://www.postgresql.org/message-id/CA+Tgmoa2ScSSVoa1qzpN9rPFmWsb=SstgFR0eBFPy1udDFm5DQ@mail.gmail.com