Comments (8)
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.
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.
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.
Are we sure it isn't supported? I'll test.
from patroni.
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.
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.
@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.
Well, because we didn't do this 4 months ago, it's going to be much harder now ...
from patroni.
Related Issues (20)
- Need Help in Setting up docker-compose-citus.yaml HOT 2
- RAFT - failed to update leader lock HOT 1
- Acceptance tests fail on Debian unstable for Postgres < 12 HOT 5
- Failed to determine PostgreSQL state from the connection HOT 1
- Parameters such as max_connections, max_replication_slots, etc changed. No apparent way to find out how, by who, what or when change occurred. HOT 1
- Patroni changed leader for some reason HOT 12
- Do not check if Port is already in use with --validate-config HOT 1
- Migrate setup.py to pyproject.toml HOT 1
- max_connection value doesn't work unless you do with patronictl edit-config HOT 3
- List order of sync_standby is inconsistent with synchronous_standby_names
- Unexpected state for replicatefrom after switchover HOT 2
- patroni-consul RPM requires consul package HOT 2
- 3.2.2 throwing unexpected exception HOT 7
- Feature request: Include replication state in Consul service tags HOT 1
- Infinite recursion in handling of replicatefrom tags HOT 3
- patroni_failsafe_mode_is_active prometheus metric always 0 HOT 3
- Unable to connect to external etcdv3 cluster with client TLS authentication (with CommonName in cert) HOT 1
- Cannot configure SSL for replication HOT 7
- wrong role in patronictl list
- Postgresql failed to start after deletion of postgresql.base.conf due to recursion HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from patroni.