diff --git a/dbutils.c b/dbutils.c index 85751021..f95c60ed 100644 --- a/dbutils.c +++ b/dbutils.c @@ -4138,7 +4138,7 @@ create_slot_name(char *slot_name, int node_id) bool -create_replication_slot(PGconn *conn, char *slot_name, PQExpBufferData *error_msg) +create_replication_slot_sql(PGconn *conn, char *slot_name, PQExpBufferData *error_msg) { PQExpBufferData query; RecordStatus record_status = RECORD_NOT_FOUND; @@ -4193,8 +4193,8 @@ create_replication_slot(PGconn *conn, char *slot_name, PQExpBufferData *error_ms slot_name); } - log_debug(_("create_replication_slot(): creating slot \"%s\" on upstream"), slot_name); - log_verbose(LOG_DEBUG, "create_replication_slot():\n%s", query.data); + log_debug(_("create_replication_slot_sql(): creating slot \"%s\" on upstream"), slot_name); + log_verbose(LOG_DEBUG, "create_replication_slot_sql():\n%s", query.data); res = PQexec(conn, query.data); termPQExpBuffer(&query); @@ -4215,7 +4215,7 @@ create_replication_slot(PGconn *conn, char *slot_name, PQExpBufferData *error_ms bool -drop_replication_slot(PGconn *conn, char *slot_name) +drop_replication_slot_sql(PGconn *conn, char *slot_name) { PQExpBufferData query; PGresult *res = NULL; @@ -4227,14 +4227,14 @@ drop_replication_slot(PGconn *conn, char *slot_name) "SELECT pg_catalog.pg_drop_replication_slot('%s')", slot_name); - log_verbose(LOG_DEBUG, "drop_replication_slot():\n %s", query.data); + log_verbose(LOG_DEBUG, "drop_replication_slot_sql():\n %s", query.data); res = PQexec(conn, query.data); if (PQresultStatus(res) != PGRES_TUPLES_OK) { log_db_error(conn, query.data, - _("drop_replication_slot(): unable to drop replication slot \"%s\""), + _("drop_replication_slot_sql(): unable to drop replication slot \"%s\""), slot_name); success = false; diff --git a/dbutils.h b/dbutils.h index 2790ccf9..eb10b3e2 100644 --- a/dbutils.h +++ b/dbutils.h @@ -560,8 +560,8 @@ PGresult *get_event_records(PGconn *conn, int node_id, const char *node_name, /* replication slot functions */ void create_slot_name(char *slot_name, int node_id); -bool create_replication_slot(PGconn *conn, char *slot_name, PQExpBufferData *error_msg); -bool drop_replication_slot(PGconn *conn, char *slot_name); +bool create_replication_slot_sql(PGconn *conn, char *slot_name, PQExpBufferData *error_msg); +bool drop_replication_slot_sql(PGconn *conn, char *slot_name); RecordStatus get_slot_record(PGconn *conn, char *slot_name, t_replication_slot *record); int get_free_replication_slot_count(PGconn *conn); int get_inactive_replication_slots(PGconn *conn, KeyValueList *list); diff --git a/repmgr-action-standby.c b/repmgr-action-standby.c index a7e92183..0dbbcb13 100644 --- a/repmgr-action-standby.c +++ b/repmgr-action-standby.c @@ -650,7 +650,7 @@ do_standby_clone(void) /* If a replication slot was previously created, drop it */ if (config_file_options.use_replication_slots == true) { - drop_replication_slot(source_conn, local_node_record.slot_name); + drop_replication_slot_sql(source_conn, local_node_record.slot_name); } log_error(_("unable to take a base backup of the primary server")); @@ -1325,7 +1325,7 @@ _do_create_recovery_conf(void) PQExpBufferData msg; initPQExpBuffer(&msg); - if (create_replication_slot(upstream_conn, + if (create_replication_slot_sql(upstream_conn, local_node_record.slot_name, &msg) == false) { @@ -3070,7 +3070,7 @@ do_standby_follow_internal(PGconn *primary_conn, PGconn *follow_target_conn, t_n } - if (create_replication_slot(follow_target_conn, + if (create_replication_slot_sql(follow_target_conn, local_node_record.slot_name, output) == false) { @@ -5828,7 +5828,7 @@ initialise_direct_clone(t_node_info *node_record) get_superuser_connection(&source_conn, &superuser_conn, &privileged_conn); - if (create_replication_slot(privileged_conn, node_record->slot_name, &event_details) == false) + if (create_replication_slot_sql(privileged_conn, node_record->slot_name, &event_details) == false) { log_error("%s", event_details.data); @@ -6114,7 +6114,7 @@ run_basebackup(t_node_info *node_record) get_superuser_connection(&upstream_conn, &superuser_conn, &privileged_conn); initPQExpBuffer(&event_details); - if (create_replication_slot(privileged_conn, node_record->slot_name, &event_details) == false) + if (create_replication_slot_sql(privileged_conn, node_record->slot_name, &event_details) == false) { log_error("%s", event_details.data); @@ -6151,7 +6151,7 @@ run_basebackup(t_node_info *node_record) { if (slot_exists_on_upstream == false) { - if (drop_replication_slot(privileged_conn, node_record->slot_name) == true) + if (drop_replication_slot_sql(privileged_conn, node_record->slot_name) == true) { log_notice(_("replication slot \"%s\" deleted on source node"), node_record->slot_name); } @@ -6696,7 +6696,7 @@ stop_backup: initPQExpBuffer(&errmsg); - if (create_replication_slot(upstream_conn, node_record->slot_name, &errmsg) == false) + if (create_replication_slot_sql(upstream_conn, node_record->slot_name, &errmsg) == false) { log_error(_("unable to create replication slot on upstream node %i"), upstream_node_id); log_detail("%s", errmsg.data); diff --git a/repmgr-client.c b/repmgr-client.c index 646a5259..49c1025e 100644 --- a/repmgr-client.c +++ b/repmgr-client.c @@ -3622,7 +3622,7 @@ drop_replication_slot_if_exists(PGconn *conn, int node_id, char *slot_name) { if (slot_info.active == false) { - if (drop_replication_slot(conn, slot_name) == true) + if (drop_replication_slot_sql(conn, slot_name) == true) { log_notice(_("replication slot \"%s\" deleted on node %i"), slot_name, node_id); }