Skip to content

Commit

Permalink
Fix healthchecks on single-database instances (#5900)
Browse files Browse the repository at this point in the history
Instances running on backends without `CREATE_DATABASE` capability will
only have the `edgedb` database in them, while the healthcheck endpoints
attempt to connect to the system database which is only present in
multi-database mode.

Fixes: #5895
  • Loading branch information
elprans committed Aug 7, 2023
1 parent 3584810 commit 7ce7162
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 150 deletions.
7 changes: 6 additions & 1 deletion edb/server/protocol/system_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,13 @@ def _response_ok(response, message):


async def _ping(server):
if server.get_backend_runtime_params().has_create_database:
dbname = edbdef.EDGEDB_SYSTEM_DB
else:
dbname = edbdef.EDGEDB_SUPERUSER_DB

return await execute.parse_execute_json(
server.get_db(dbname=edbdef.EDGEDB_SYSTEM_DB),
server.get_db(dbname=dbname),
query="SELECT 'OK'",
output_format=compiler.OutputFormat.JSON_ELEMENTS,
# Disable query cache because we need to ensure that the compiled
Expand Down

0 comments on commit 7ce7162

Please sign in to comment.