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

Adaptive Postgres HA Support #2920

Merged
merged 6 commits into from
Sep 13, 2021
Merged

Adaptive Postgres HA Support #2920

merged 6 commits into from
Sep 13, 2021

Conversation

fantix
Copy link
Member

@fantix fantix commented Sep 8, 2021

Depends on #2580, implementation of #2887

This PR supports a "adaptive" Postgres HA cluster which doesn't actively notify EdgeDB of failovers.

@fantix fantix requested review from 1st1 and elprans September 8, 2021 17:44
@fantix fantix force-pushed the ha-passive branch 3 times, most recently from 9fbc961 to 42c74af Compare September 9, 2021 20:28
Copy link
Member

@1st1 1st1 left a comment

Choose a reason for hiding this comment

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

Looks good to me. I only have a few nit comments.

def get_backend(parsed_dsn: urllib.parse.ParseResult) -> Optional[HABackend]:
backend, _, sub_scheme = parsed_dsn.scheme.partition("+")
if backend == "stolon":
from . import stolon
Copy link
Member

Choose a reason for hiding this comment

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

Any reason for a dynamic import?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was to break a circular import ha.base <-> ha.base.stolon

self.server = server

def mark_as_system_db(self):
assert defines.EDGEDB_SYSTEM_DB in self.dbname
Copy link
Member

Choose a reason for hiding this comment

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

Why does this check use in and not ==?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's related to multi-tenancy: #2158

@fantix fantix marked this pull request as ready for review September 13, 2021 20:09
@fantix fantix changed the title Passive Postgres HA Support Adaptive Postgres HA Support Sep 13, 2021
@fantix fantix merged commit a8b3bc2 into geldata:master Sep 13, 2021
@fantix fantix deleted the ha-passive branch September 13, 2021 20:20
@fantix fantix self-assigned this Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants