"witness register": fix primary node check

Addresses GitHub #377, based on report by user yonj1e in #373.
This commit is contained in:
Ian Barwick
2018-02-08 16:28:50 +09:00
parent ee2df36a76
commit 76a93af15c
3 changed files with 9 additions and 2 deletions

View File

@@ -110,12 +110,12 @@ do_witness_register(void)
}
/* check primary node's recovery type */
recovery_type = get_recovery_type(witness_conn);
recovery_type = get_recovery_type(primary_conn);
if (recovery_type == RECTYPE_STANDBY)
{
log_error(_("provided primary node is a standby"));
log_error(_("provide the connection details of the cluster's primary server"));
log_hint(_("provide the connection details of the cluster's primary server"));
PQfinish(witness_conn);
PQfinish(primary_conn);