Re: Extensibility of the PostgreSQL wire protocol

From: Jan Wieck <jan(at)wi3ck(dot)info>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Damir Simunic <damir(dot)simunic(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Extensibility of the PostgreSQL wire protocol
Date: 2021-02-24 15:46:54
Message-ID: f7bfa2e3-8dcf-0668-f87e-2df0f0aa5f16@wi3ck.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2/19/21 10:13 AM, Jan Wieck wrote:

> Give the function, that postmaster is calling to accept a connection
> when a server_fd is ready, a return code that it can use to tell
> postmaster "forget about it, don't fork or do anything else with it".
> This function is normally calling StreamConnection() before the
> postmaster then forks the backend. But it could instead hand over the
> socket to the pool background worker (I presume Jonah is transferring
> them from process to process via UDP packet). The pool worker is then
> launching the actual backends which receive a requesting client via the
> same socket transfer to perform one or more transactions, then hand the
> socket back to the pool worker.

The function in question, which is StreamConnection() and with this
patch can be replaced with an extension funtion via the fn_accept
pointer, already has that capability. If StreamConnection() or its
replacement returns a NULL pointer, the postmaster just skips calling
BackendStartup(). So everything is already in place for the above to work.

Regards, Jan

--
Jan Wieck
Principle Database Engineer
Amazon Web Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2021-02-24 16:03:39 Re: Bizarre behavior of \w in a regular expression bracket construct
Previous Message Joel Jacobson 2021-02-24 15:23:07 Re: Bizarre behavior of \w in a regular expression bracket construct