Re: [HACKERS] Client Connection redirection support for PostgreSQL - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: [HACKERS] Client Connection redirection support for PostgreSQL
Date
Msg-id CAMsr+YF8spMPQRb4QQFXHkOXAy-Uspc4T5TA5EGYvjqOhAdgSQ@mail.gmail.com
Whole thread Raw
In response to [HACKERS] Client Connection redirection support for PostgreSQL  (Satyanarayana Narlapuram <Satyanarayana.Narlapuram@microsoft.com>)
Responses Re: [HACKERS] Client Connection redirection support for PostgreSQL  (Satyanarayana Narlapuram <Satyanarayana.Narlapuram@microsoft.com>)
Re: [HACKERS] Client Connection redirection support for PostgreSQL  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 2 November 2017 at 14:02, Satyanarayana Narlapuram
<Satyanarayana.Narlapuram@microsoft.com> wrote:
> Proposal:
>
> Add the ability to the PostgreSQL server instance to route the traffic to a
> different server instance based on the rules defined in server’s pg_bha.conf
> configuration file. At a high level this enables offloading the user
> requests to a different server instance based on the rules defined in the
> pg_hba.conf configuration file.

pg_hba.conf is "host based access [control]" . I'm not sure it's
really the right place.

> Some of the interesting scenarios this
> enables include but not limited to - rerouting traffic based on the client
> hosts, users, database, etc. specified, redirecting read-only query traffic
> to the hot stand by replicas, and in multi-master scenarios.

When this has come up before, one of the issues has been determining
what exactly should constitute "read only" vs "read write" for the
purposes of redirecting work.

There are a bunch of issues there. If you're doing "read only" txns
and then do something "read write" and get redirected, the destination
doesn't have your prepared statements, any WITH HOLD cursors, temp
tables, etc you were working with. Strangeness ensues.

But we now have a session-intent stuff though. So we could possibly do
it at session level.

Backends used just for a redirect would be pretty expensive though.

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: [HACKERS] proposal: schema variables
Next
From: Nico Williams
Date:
Subject: Re: [HACKERS] proposal: schema variables