Giter Site home page Giter Site logo

The great connection cleanup about patroni HOT 8 CLOSED

zalando avatar zalando commented on August 28, 2024
The great connection cleanup

from patroni.

Comments (8)

alexeyklyukin avatar alexeyklyukin commented on August 28, 2024

I think we should accept both name=value and URI format when getting connection strings from the user.

As for the internal format, it makes sense to store all connection informations as dicts. This simplifies checking whether two conninfos represent the same connection, as well as modifying them.

As for the primary_conninfo in recovery.conf, we don't have a choice: the URI format was only introduced in 9.5, which is yet to be released. It makes sense to use the name=value connection strings when we output the value somewhere (i.e. to the recovery.conf, pg_rewind connection string, etc).

As for the usage of two types of connections, it won't work: pg_rewind requires a superuser connection to the master host, so you need it as well (there is a discussion to patch pg_rewind to use only replication connection, but this is not going to happen in 9.5).

The idea to go through the API for everything except the local, the replication and pg_rewind connection looks reasonable to me (aren't we doing it already?)

Note that we might be slow on providing feedback this week: the team is on PGConf.EU conference until Monday...

from patroni.

jberkus avatar jberkus commented on August 28, 2024

Ah, ok, so there's three types of connections then. I haven't really looked at the pg_rewind code; I hadn't planned on using pg_rewind short of 9.5.

I'd forgotten about that limitation with recovery.conf. So, then we should make the canonical type dictionaries? With a single canonical function for creating connection strings?

If we're not going to use URIs, then wouldn't it make more sense to store the connection info as JSON in the DCS?

from patroni.

a1exsh avatar a1exsh commented on August 28, 2024

On Thu, Oct 29, 2015 at 6:58 PM, Josh Berkus [email protected]
wrote:

Ah, ok, so there's three types of connections then. I haven't really
looked at the pg_rewind code; I hadn't planned on using pg_rewind short of
9.5.

I'd forgotten about that limitation with recovery.conf. So, then we should
make the canonical type dictionaries? With a single canonical function for
creating connection strings?

Actually I wonder why this wasn't back-patched to 9.2... Maybe we should
raise a point on the hackers list. Original discussion:
http://www.postgresql.org/message-id/[email protected]

Alex

from patroni.

jberkus avatar jberkus commented on August 28, 2024

Are we sure it isn't supported? I'll test.

from patroni.

a1exsh avatar a1exsh commented on August 28, 2024

On Thu, Oct 29, 2015 at 9:37 PM, Josh Berkus [email protected]
wrote:

Are we sure it isn't supported? I'll test.

I am pretty sure it isn't, because of this:
https://github.com/postgres/postgres/blob/REL9_4_STABLE/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c#L90

Appending that to an URI doesn't do the trick.

from patroni.

feikesteenbergen avatar feikesteenbergen commented on August 28, 2024

three types of connections then

The third can be generated from the key value pairs, as you can specify the connection string that way:

$ pg_rewind -D /tmp/ --source-server="dbname=postgres host=localhost user=dummy"

could not connect to server: FATAL:  role "dummy" does not exist

from patroni.

LappleApple avatar LappleApple commented on August 28, 2024

@jberkus @feikesteenbergen @a1exsh @alexeyklyukin @CyberDem0n Any agreement/compromise we can come to here so we can adopt/formalize any necessary standards + close out the issue?

from patroni.

jberkus avatar jberkus commented on August 28, 2024

Well, because we didn't do this 4 months ago, it's going to be much harder now ...

from patroni.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.