diff --git a/HISTORY b/HISTORY
index 74c92fc2..684a20fb 100644
--- a/HISTORY
+++ b/HISTORY
@@ -27,6 +27,8 @@
server and logging output is not explicitly redirected (Ian)
repmgr: improve switchover log messages and exit code when old primary could
not be shut down cleanly (Ian)
+ repmgr: check demotion candidate can make a replication connection to the
+ promotion candidate before executing a switchover; GitHub #370 (Ian)
repmgr: add check for sufficient walsenders/replication slots before executing
a switchover; GitHub #371 (Ian)
repmgr: add --dry-run mode to "repmgr standby follow"; GitHub #368 (Ian)
diff --git a/dbutils.c b/dbutils.c
index 5a256f8f..bf491de7 100644
--- a/dbutils.c
+++ b/dbutils.c
@@ -2738,6 +2738,11 @@ get_node_replication_stats(PGconn *conn, int server_version_num, t_node_info *no
PQExpBufferData query;
PGresult *res = NULL;
+ if (server_version_num == UNKNOWN_SERVER_VERSION_NUM)
+ server_version_num = get_server_version(conn, NULL);
+
+ Assert(server_version_num != UNKNOWN_SERVER_VERSION_NUM);
+
initPQExpBuffer(&query);
appendPQExpBuffer(&query,
diff --git a/doc/appendix-release-notes.sgml b/doc/appendix-release-notes.sgml
index 02e37fc6..55d1b9fe 100644
--- a/doc/appendix-release-notes.sgml
+++ b/doc/appendix-release-notes.sgml
@@ -166,6 +166,13 @@
+
+
+ add check to verify the demotion candidate can make a replication connection to the
+ promotion candidate before executing a switchover (GitHub #370)
+
+
+
add check for sufficient walsenders and replication slots on the promotion candidate before executing