Geo: Let sysadmins run FDW queries from the tracking DB
Same problem as https://gitlab.com/gitlab-org/gitlab-ee/issues/10348.
In an HA setup, with the tracking DB on its own machine, you can't connect to the tracking DB and run FDW queries without jumping through a bunch of hoops.
Typical frustrating experience:
- SSH into tracking DB machine
sudo gitlab-geo-psql- Run some query that includes references to
gitlab_secondary(which is the foreign server)ERROR: user mapping not found for "gitlab-psql"- Oh, I need to be
gitlab_geouser since it created the foreign server\qsudo gitlab-geo-psql -U gitlab_geopsql: FATAL: Peer authentication failed for user "gitlab_geo"- Oh, we configured PG to not allow peer authentication, I'll connect from an app node
- SSH into app node
sudo gitlab-geo-psqlpsql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/opt/gitlab/geo-postgresql/.s.PGSQL.5431"?- Oh, the command doesn't do what you'd hope
gitlab-geo-psql -U gitlab_geo -h 10.138.0.38Password for user gitlab_geo:- Oh I need to get the password (if you're very familiar with GitLab you know it's in plaintext somewhere in
/etc/gitlab/gitlab.rbbut you get the point)Let's make this easier.
cc @brodock
Edited by Michael Kozono