Re: Observability in Postgres - Mailing list pgsql-hackers

From Jacob Champion
Subject Re: Observability in Postgres
Date
Msg-id 8fc6ea1c7a12276044b60fc55db371fbbb8d414e.camel@vmware.com
Whole thread Raw
In response to Re: Observability in Postgres  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
On Wed, 2022-02-16 at 02:10 -0500, Greg Stark wrote:
> On Tue, 15 Feb 2022 at 17:37, Magnus Hagander <magnus@hagander.net> wrote:
> 
> > But I think you'll run into a different problem much earlier. Pretty
> > much everything out there is going to want to speak http(s). How are
> > you going to terminate that, especially https, on the same port as a
> > PostgreSQL connection? PostgreSQL will have to reply with it's initial
> > negotiating byte before anything else is done, including the TLS
> > negotiation, and that will kill anything http.
> 
> Yeah this is a serious problem. I think there are other even more
> compelling reasons someone else was already looking at this so I'm
> kind of hoping it solves itself :)

Yeah, this seems like a shoe-in with implicit TLS support and ALPN. So
hopefully we can help that piece solve itself. :)

That said, I feel like I should probably advise against forwarding HTTP
through Postgres. With implicit TLS you should be able to run a reverse
proxy out front, which could check the ALPN and redirect traffic to the
bgworker port as needed. (I don't think you have to terminate TLS in
order to do this -- so channel bindings et al should be unaffected --
but I don't have experience with that.)

So Postgres wouldn't have to touch HTTP traffic at all, and the
bgworker extension can upgrade its HTTP stack completely independently.
(And if you don't want to share ports, you don't have to deploy the
proxy at all.)

--Jacob

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: USE_BARRIER_SMGRRELEASE on Linux?
Next
From: Michael Banck
Date:
Subject: Re: Observability in Postgres