| From: | Tatsuo Ishii <ishii(at)postgresql(dot)org> |
|---|---|
| To: | nadav(at)tailorbrands(dot)com |
| Cc: | pgpool-hackers(at)lists(dot)postgresql(dot)org |
| Subject: | Re: Removing support for FE/BE protocol version 2 |
| Date: | 2026-10-13 03:53:58 |
| Message-ID: | 20261013.125358.1171170128787374410.ishii@postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgpool-hackers |
Hi Nadav,
> Hi,
>
> Thanks for v4. I applied it on master. The build is clean (no new
> warnings, also with -Wextra and -Wunused-parameter), the full
> regression suite passes on PG16 (80/80), and 045 passes. On the wire
> the reply is 'E' + "FATAL: unsupported frontend protocol 2.0\n" +
> '\0', and the log has a single FATAL line. All the v3 points are fixed.
>
> Since we are now removing the protoMajor-specific code entirely, here
> is what is still left. None of it is a bug:
>
> - pool_hba.c (around lines 1342 and 1380): two
> "frontend->protoVersion == PROTO_MAJOR_V3" checks that are now
> always true. This file was on your original list.
Oops. I forgot it. Will fix.
> - child.c (around line 1031): "new_sp->major == PROTO_MAJOR_V3 &&
> sp->application_name".
Will fix.
> - The MAJOR() macro in pool.h has no callers now. So
> pool_get_major_version(), pool_set_major_version() (called only from
> child.c) and session_context->major are dead too, as is the
> pool_get_major_version() stub in the 010 test.
Agreed on removing these.
> - pool_get_cp() and pool_discard_cp() still take protoMajor and compare
> it with sp->major. It is harmless, but the argument could be dropped
> along with the rest.
I would like to keep the protoMajor for now.
Now clients can use protocol 3.0 or 3.2. So comparing protoMajor in
pool_get_cp() is not sufficient. It needs to compare protoMinor as
well. I would like to fix this in a separate patch since this is not
related to dropping v2 support.
> - pool.h: sbuf/sbufsz in POOL_CONNECTION are now only initialized and
> freed in pool_stream.c. Their only user was pool_read_string(), which
> is gone (the comment still says "buffer for pool_read_string").
I will remove them.
> - pgproto/read.c:411 still uses %m.
Will fix.
> - pgproto/send.c write_it(): "int errsave = errno;" needs pgindent
> (alignment and a blank line after the declaration).
Yeah. There are tons of places that need pgindent. We will run
pgindent on whole source files before GA is out.
> - pool_proto_modules.h: the header comment ends with a dangling comma
> ("pool_proto_modules.c,"), and there is a double blank line after
> log_backend_messages().
Will fix.
> Other than these, the patches look good to me. Doing the items above in
> a follow-up commit is probably fine too.
I have left the pool_get_cp() and pool_discard_cp() issue as described
above. Other than that, attached v5 should address all the problems
you pointed out.
Thank you so much for your review!
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp
| Attachment | Content-Type | Size |
|---|---|---|
| v5-0001-Reject-v2-protocol-startup-packet.patch | application/octet-stream | 193.0 KB |
| v5-0002-Modify-pgproto-as-a-test-driver.patch | application/octet-stream | 18.5 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Nadav Shatz | 2026-10-13 11:49:43 | Re: Removing support for FE/BE protocol version 2 |
| Previous Message | Nadav Shatz | 2026-10-12 09:10:58 | Re: Removing support for FE/BE protocol version 2 |