Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix healthchecks on single-database instances #5900

Merged
merged 1 commit into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines +93 to +95

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it be adjusted to the database name provided in BACKEND_DSN? i.e. if the (one and only) available database is named differently (not edgedb), will it still work?

#5592 (comment)

In single db mode EdgeDB uses the database provided in --backend-dsn (EDGEDB_SERVER_BACKEND_DSN), e.g. if you give it postgres://host:port/mydb it'll use mydb.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. In single-database mode edgedb gets translated to whatever was specified in the backend DSN.


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
Loading
Loading