Skip to content

Conversation

DAlperin
Copy link
Contributor

I stole this sql from repmgrs internals https://github.com/EnterpriseDB/repmgr/blob/3b897318998114ba2760057c9a18bc7601771ca3/dbutils.c#L2773.

I need a some sort of chaos monkey script to test this kind of code.

@davissp14
Copy link
Contributor

👍

@DAlperin
Copy link
Contributor Author

@davissp14 tested this, works as expected now. Ready to merge if you are

@DAlperin
Copy link
Contributor Author

Actually no, this isn't quite there yet. We end up in the:

// If we are here, we are a standby or a demoted primary who needs
// to be reconfigured as a standby.

Also if we are joining the cluster for the first time when there already is an elected leader. In that case we don't have a role at all yet. I need to handle that.

@DAlperin
Copy link
Contributor Author

Ok fixed.

@DAlperin DAlperin merged commit 80f91ca into master Dec 13, 2022
@davissp14 davissp14 deleted the figure_out_role 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