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

PRIMARY_REGION not considered on cluster initialization #11

Open
davissp14 opened this issue Aug 9, 2021 · 2 comments
Open

PRIMARY_REGION not considered on cluster initialization #11

davissp14 opened this issue Aug 9, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@davissp14
Copy link
Contributor

davissp14 commented Aug 9, 2021

Stolon has a keeper flag named can-be-master that was introduced by the following PR:
sorintlab/stolon#697

We use this flag in combination with the PRIMARY_REGION env var to restrict primary eligibility to a specific region.

Problem
The problem is that Stolon's Sentinel does not consider this flag when assigning the primary on cluster initialization. During the cluster initialization process, the primary keeper is chosen at random.

More information can be found here: sorintlab/stolon#840

Workaround
The recommended approach as of right now, is to provision your cluster within the primary region BEFORE spinning up cross-region read-replicas. If you spin everything up at once, you will be at risk of an out-of-region member being assigned primary.

@davissp14 davissp14 added the bug Something isn't working label Aug 9, 2021
@davissp14 davissp14 changed the title PRIMARY_REGION is not considered on cluster initialization PRIMARY_REGION not considered on cluster initialization Aug 9, 2021
@mrkurt
Copy link
Contributor

mrkurt commented Aug 9, 2021

This is (currently) a non issue for flyctl pg create right? It just creates a cluster in a single region.

@davissp14
Copy link
Contributor Author

davissp14 commented Aug 9, 2021

@mrkurt Right, as far as provisioning goes this would only be an issue for manual deployments.

However, in the event the backend store is lost, the cluster will be forced to re-initialize. So it would seem there are additional opportunities outside of the initial provision where this could potentially bite someone.

Update

One notable scenario of concern would be someone transitioning their backend store from consul to etcd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants