"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

@@ -7,6 +7,7 @@
during "standby clone" (Ian)
repmgr: report error code on follow/rejoin failure due to non-available
replication slot (Ian)
repmgr: ensure "node rejoin" checks for available replication slots (Ian)
5.0 2019-10-15
general: add PostgreSQL 12 support (Ian)

View File

@@ -48,6 +48,14 @@
<sect2>
<title>Bug fixes</title>
<para>
<itemizedlist>
<listitem>
<para>
Ensure <link linkend="repmgr-node-rejoin"><command>repmgr node rejoin</command></link>
checks for available replication slots on the rejoin target.
</para>
</listitem>
</itemizedlist>
<itemizedlist>
<listitem>
<para>

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
*/