From 562b6ddfc2cdb0e3cd49d9eaf4e51c161030ed0d Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Wed, 21 Mar 2018 13:11:30 +0900 Subject: [PATCH] Add error code ERR_FOLLOW_FAIL --- errcode.h | 1 + repmgr-action-standby.c | 19 +++++++++---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/errcode.h b/errcode.h index c152967a..9e4fd158 100644 --- a/errcode.h +++ b/errcode.h @@ -44,5 +44,6 @@ #define ERR_REGISTRATION_SYNC 20 #define ERR_OUT_OF_MEMORY 21 #define ERR_SWITCHOVER_INCOMPLETE 22 +#define ERR_FOLLOW_FAIL 23 #endif /* _ERRCODE_H_ */ diff --git a/repmgr-action-standby.c b/repmgr-action-standby.c index 31b933c7..d5386109 100644 --- a/repmgr-action-standby.c +++ b/repmgr-action-standby.c @@ -2109,7 +2109,7 @@ do_standby_follow(void) log_hint(_("alter \"primary_follow_timeout\" in \"repmgr.conf\" to change this value")); } - exit(ERR_BAD_CONFIG); + exit(ERR_FOLLOW_FAIL); } if (runtime_options.dry_run == true) @@ -2128,7 +2128,7 @@ do_standby_follow(void) log_error(_("unable to find record for new upstream node %i"), runtime_options.upstream_node_id); PQfinish(primary_conn); - exit(ERR_BAD_CONFIG); + exit(ERR_FOLLOW_FAIL); } /* @@ -2161,7 +2161,7 @@ do_standby_follow(void) { log_error(_("unable to determine number of free replication slots on the primary")); PQfinish(primary_conn); - exit(ERR_BAD_CONFIG); + exit(ERR_FOLLOW_FAIL); } if (free_slots == 0) @@ -2169,7 +2169,7 @@ do_standby_follow(void) log_error(_("no free replication slots available on the primary")); log_hint(_("consider increasing \"max_replication_slots\"")); PQfinish(primary_conn); - exit(ERR_BAD_CONFIG); + exit(ERR_FOLLOW_FAIL); } else if (runtime_options.dry_run == true) { @@ -2193,7 +2193,7 @@ do_standby_follow(void) { log_error(_("unable to establish a replication connection to the primary node")); PQfinish(primary_conn); - exit(ERR_BAD_CONFIG); + exit(ERR_FOLLOW_FAIL); } else if (runtime_options.dry_run == true) { @@ -2210,7 +2210,7 @@ do_standby_follow(void) log_error(_("unable to query the primary node's system identification")); PQfinish(primary_conn); PQfinish(repl_conn); - exit(ERR_BAD_CONFIG); + exit(ERR_FOLLOW_FAIL); } if (primary_identification.system_identifier != local_system_identifier) @@ -2221,7 +2221,7 @@ do_standby_follow(void) primary_identification.system_identifier); PQfinish(primary_conn); PQfinish(repl_conn); - exit(ERR_BAD_CONFIG); + exit(ERR_FOLLOW_FAIL); } else if (runtime_options.dry_run == true) { @@ -2308,7 +2308,7 @@ do_standby_follow_internal(PGconn *primary_conn, t_node_info *primary_node_recor log_error(_("unable to retrieve record for node %i"), config_file_options.node_id); - *error_code = ERR_BAD_CONFIG; + *error_code = ERR_FOLLOW_FAIL; return false; } @@ -2438,8 +2438,7 @@ do_standby_follow_internal(PGconn *primary_conn, t_node_info *primary_node_recor if (!create_recovery_file(&local_node_record, &recovery_conninfo, config_file_options.data_directory, true)) { - /* XXX ERR_RECOVERY_FILE ??? */ - *error_code = ERR_BAD_CONFIG; + *error_code = ERR_FOLLOW_FAIL; return false; }