这是indexloc提供的服务,不要输入任何密码
Skip to content

Stored metadata connection string overwritres environmental variable (v2) #7270

@ro-savage

Description

@ro-savage

Version: 2.0.1
Database: Postgres 12.6
Version: Self-hosted

We are using a docker-image and we regularly change databases, and we regularly copy databases between postgres instances (pg_dump and pg_restore). With v1 we were using an env vars to change between databases.

However since v2, hasura will now use the environment variable to connect to a database, then read the metadata stored in hdb_metadata and proceed to update the database connection to what is stored in the meta data.

This causes hasura to be looking at the incorrect database. Worse for us, is because these databases are identical there is no way for us to know without manually checking the connection string.

We've had to write a script that will drop hdb_catalog after each pg_dump.

I am not sure of the best solution to this. But it seems very strange behaviour to use the connection string, connect to the database, read the metadata, and instantly connect to entirely different database (the logs also do not show this reconnection. It just shows the initial database connection)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions