hasura / hasura/graphql-engine
Validate connectivity to all connection strings when adding/editing a source
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Is your proposal related to a problem?
Currently Hasura does not validate all of a source's connection strings when adding or editing a source's configuration. A source may have multiple read-replicas specified and Hasura will only check one of the read-replica connection strings at random.
This is because "checking a connection string" actually means "performing database introspection". When Hasura introspects the database, it performs a read only query, which chooses a read-replica at random to run on. This means that if one of your read replica connection strings is incorrect (or if your primary connection string is incorrect) your source update may succeed because the introspection operation executed against a working read-replica connection string and the other connection strings were not looked at.
This results in Hasura queries to that source failing sporadically if the query is issued to a broken connection string.
### Describe the solution you'd like
I want the source creation/update only to succeed if all connection strings (primary + all replicas) result in successful database connection. That way, I can be confident that when I create/update my source, all my configuration is correct and that none of my incoming requests will hit a broken connection string and fail.
Contributor guide
Research direction
Start with the source creation and update handling and the database introspection path described in the issue. Done means validation succeeds for the primary connection string and every configured read-replica string before the source change succeeds.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend-api-design, databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100