Skip to content

Conversation

DAlperin
Copy link
Contributor

@davissp14
Copy link
Contributor

davissp14 commented Dec 12, 2022

Nice! We may actually want to configure priority on members outside of the primary region as well.
https://raw.githubusercontent.com/2ndQuadrant/repmgr/master/repmgr.conf.sample

@DAlperin
Copy link
Contributor Author

@davissp14 if we just don't want nodes outside the primary location to be promoted isn't that already accomplished just with location?

In a failover situation, repmgrd will check if any servers in the same location as the current primary node are visible. If not, repmgrd will assume a network interruption and not promote any node in any other location (it will however enter degraded monitoring mode until a primary becomes visible).

@davissp14
Copy link
Contributor

davissp14 commented Dec 12, 2022

I'd have to confirm by reading the source, but my interpretation is that Location is primarily used for mitigating network splits. E.G. If all nodes are visible within the location out-of-region nodes in a different location would still be eligible based on their priority setting.

@DAlperin
Copy link
Contributor Author

Ah interesting. My impression from the docs was that location dictates whether a node can be promoted. A quick grep in the source yields this but I'll read a bit more https://github.com/EnterpriseDB/repmgr/blob/master/repmgrd-physical.c#L3022-L3027

@DAlperin
Copy link
Contributor Author

DAlperin commented Dec 12, 2022

If I'm reading this right (which I'm not 100% sure I am) I think nodes outside the primary location will not be a candidate for election: https://github.com/EnterpriseDB/repmgr/blob/master/repmgrd-physical.c#L4372-L4402

@davissp14
Copy link
Contributor

davissp14 commented Dec 12, 2022

https://github.com/EnterpriseDB/repmgr/blob/master/repmgrd-physical.c#L4715-L4729

As far as I can tell, using location alone should do the trick!

Feel free to merge whenever!

@DAlperin DAlperin merged commit d51e95c into master Dec 12, 2022
@DAlperin
Copy link
Contributor Author

@davissp14 davissp14 deleted the only_primary_region_primary branch February 25, 2023 01:57
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.

2 participants