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

Support Stolon+Consul (acting as a Stolon proxy) #2580

Closed
wants to merge 6 commits into from

Conversation

fantix
Copy link
Member

@fantix fantix commented Jun 7, 2021

This is a prototype supporting Stolon+Consul high availability. Launch the EdgeDB server with:

--postgres-dsn=postgresql://user:pass@<ignored host/port>/dbname
--ha-cluster=stolon+consul:///<stolon cluster name>

EdgeDB will subscribe to local Consul http://127.0.0.1:8500/v1/kv/stolon/cluster/{cluster_name}/clusterdata for updates from Stolon, and switch over to the new master Postgres when there is one.

TODO:

  • better understand Stolon protocol, e.g. detect partition and disconnect
  • remove hard-code
  • add tests

PR is built on #2557 and #2574.

@fantix fantix requested a review from elprans June 7, 2021 15:33
@fantix fantix force-pushed the ha-stolon-consul branch 4 times, most recently from 68fa8fb to 386894e Compare June 8, 2021 19:37
@1st1
Copy link
Member

1st1 commented Jun 8, 2021

Please merge the signals PR and rebase this to simplify the review

@fantix fantix force-pushed the ha-stolon-consul branch 2 times, most recently from 75f7a13 to 3359280 Compare June 10, 2021 17:49
@fantix fantix force-pushed the ha-stolon-consul branch 9 times, most recently from b30c863 to a598e29 Compare August 18, 2021 21:36
@fantix fantix force-pushed the ha-stolon-consul branch 2 times, most recently from 287d1b9 to 344e84b Compare August 24, 2021 22:37
@fantix fantix changed the title DRAFT: support Stolon+Consul (acting as a Stolon proxy) Support Stolon+Consul (acting as a Stolon proxy) Aug 24, 2021
@fantix fantix marked this pull request as ready for review August 24, 2021 23:15
@fantix fantix requested review from 1st1 and elprans August 24, 2021 23:15
Also added a error type when sys_pgcon should retry connecting:
    0A000: cannot use serializable mode in a hot standby

Also added basic TLS support for Consul connection.

Now --postgres-dsn supports the following protocols:

* postgresql://
* postgres:// (alias of postgresql://)
* stolon+consul+http://
* stolon+consul+https://
* stolon+consul:// (alias of stolon+consul+http://)
@fantix fantix mentioned this pull request Sep 8, 2021
1 task
@1st1
Copy link
Member

1st1 commented Sep 10, 2021

Should this one be closed in favor of #2920?

@fantix
Copy link
Member Author

fantix commented Sep 10, 2021

Sure, it's included in #2920 anyways.

@fantix fantix closed this Sep 10, 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