EnterpriseDB/repmgr

Add support for a quorum when performing election

Closed this issue · 10 comments

It would be nice for repmgrd to have the option to perform a failover only if there's a quorum of nodes participating in the election run.

It is possible to script this through the validation hook but this increases the failover time - and repmgrd already has the knowledge of which nodes participated in the election.

I plan to send a patch to add more parameters to the failover_validation_command, such as total number of nodes sharing the current primary and nodes that participated in the election.

This way a check like this can be implemented in the failover_validation_command without extra processing, while the change would be backwards compatible with any repmgr installation due to using new parameters.

Ian, do you agree with this approach ?

Ian, do you agree with this approach ?

Seems reasonable, patch welcome :).

Posted a patch #651

Thanks, will look at it, though might take a few days due to other commitments.

No worries, the patch is rather simple/mechanical - grouping the current election counts in a struct, adding the total numbers of nodes to it and passing it down the failover validation command.

Ping

Ping

Hi, yes am aware of this, per previous comment currently have other commitments so might be a few more days before I get to this.

Any updates ?

Resolving this one, basic quorum check is already available in repmgr and more complex ones can be implemented through the newly-added parameters in the failover validation command.