Re: Make query cancellation keys longer
Jelte Fennema-Nio <postgres@jeltef.nl>
From: Jelte Fennema-Nio <postgres@jeltef.nl>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>,
pgsql-hackers <pgsql-hackers@postgresql.org>, Thomas Munro <thomas.munro@gmail.com>
Date: 2025-02-22T14:58:26Z
Lists: pgsql-hackers
Attachments
- v4-0001-libpq-Add-PQfullProtocolVersion-to-exports.txt.patch (text/x-patch) patch v4-0001
- v4-0002-libpq-Trace-NegotiateProtocolVersion-correctly.patch (text/x-patch) patch v4-0002
- v4-0003-libpq-Handle-NegotiateProtocolVersion-message-dif.patch (text/x-patch) patch v4-0003
- v4-0004-libpq-Add-min-max_protocol_version-connection-opt.patch (text/x-patch) patch v4-0004
- v4-0005-Bump-protocol-version-to-3.2.patch (text/x-patch) patch v4-0005
- v4-0006-Add-timingsafe_bcmp-for-constant-time-memory-comp.patch (text/x-patch) patch v4-0006
- v4-0007-Make-cancel-request-keys-longer.patch (text/x-patch) patch v4-0007
On Mon, 9 Sept 2024 at 17:58, Robert Haas <robertmhaas@gmail.com> wrote: > > On Fri, Aug 16, 2024 at 11:29 AM Robert Haas <robertmhaas@gmail.com> wrote: > > > I'll split this patch like that, to make it easier to compare and merge > > > with Jelte's corresponding patches. > > > > That sounds great. IMHO, comparing and merging the patches is the next > > step here and would be great to see. > > Heikki, do you have any update on this work? My patchset in the other protocol thread needed a rebase. So I took that as an opportunity to rebase this patchset on top of it, because this seems to be the protocol change that we can most easily push over the finish line. 1. I changed the last patch from Heikki to only contain the changes for the cancel lengthening. The general protocol change related things I merged with mine (I only kept some error handling and docs). 2. I also removed the length field in the new BackendKey definition, eventhough I asked for that addition previously. I agree with Heikki that it's actually easier to parse and create without, because you can use the same code for both versions. 3. I made our timingsafe_bcmp implementation call into OpenSSL's CRYPTO_memcmp. One open question on the last patch is: Document what the maximum size of the cancel key is that the client can expect? I think Jacob might have some ideas on that.
Commits
-
Add timingsafe_bcmp(), for constant-time memory comparison
- b282280e9b69 14.23 landed
- 9dcfcb92fff8 15.18 landed
- 1604939b2210 16.14 landed
- 8e34acfda115 17.10 landed
- 09be39112654 18.0 landed
-
Add missing declarations to pg_config.h.in
- b82e7eddb023 18.0 landed
-
docs: Add a new section and a table listing protocol versions
- b05751220b0c 18.0 landed
-
Make cancel request keys longer
- a460251f0a1a 18.0 landed
-
libpq: Add min/max_protocol_version connection options
- 285613c60a7a 18.0 landed
-
libpq: Handle NegotiateProtocolVersion message differently
- 5070349102af 18.0 landed
-
docs: Update phrase on message lengths in the protocol
- 85d799ba8a7f 18.0 landed
-
libpq: Trace all NegotiateProtocolVersion fields
- e87c14b19ed4 18.0 landed
-
libpq: Add PQfullProtocolVersion to exports.txt
- c9d94ea2158b 18.0 landed
-
Move cancel key generation to after forking the backend
- 9d9b9d46f3c5 18.0 landed