Issue 53: stopping of primary when it becomes isolated #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves #53
Create two new config keys:
The minimum number of nodes the master should be replicating with.
If the number of replicating nodes falls below this mark, then
too_few_replicating_nodes_command is called if defined.
When the number of replicating nodes on the master falls
below minimum_replicating_nodes, this command is called.
Note that it will be called repeatedly as long as this condition continues.
The query that is run on the master node is enhanced to count the number
of records in pg_stat_replication; this is stored in in the field
pg_master_replication_connections.
The too_few_replicating_nodes_command can simply stop the master, or do
more checking first, or whatever. Because the script is called repeatedly,
if you want to stop the master, you should first test whether it is running,
to avoid pg_ctl giving errors.