"node rejoin": check for available replication slots on the rejoin target

"standby follow" did this already, but "node rejoin" didn't.
This commit is contained in:
Ian Barwick
2020-02-03 17:03:20 +09:00
parent cd7f36a6fd
commit e2a362a171
3 changed files with 24 additions and 0 deletions

View File

@@ -2228,6 +2228,21 @@ do_node_rejoin(void)
exit(ERR_BAD_CONFIG);
}
/*
* Sanity-check replication slot availability
*/
if (config_file_options.use_replication_slots)
{
bool slots_available = check_replication_slots_available(primary_node_record.node_id,
primary_conn);
if (slots_available == false)
{
PQfinish(primary_conn);
exit(ERR_BAD_CONFIG);
}
}
/*
* sanity-check that it will actually be possible to stream from the new upstream
*/