mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Add function resume_wal_replay()
This commit is contained in:
35
dbutils.c
35
dbutils.c
@@ -2000,6 +2000,41 @@ promote_standby(PGconn *conn, bool wait, int wait_seconds)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
resume_wal_replay(PGconn *conn)
|
||||||
|
{
|
||||||
|
PGresult *res = NULL;
|
||||||
|
PQExpBufferData query;
|
||||||
|
bool success = true;
|
||||||
|
|
||||||
|
initPQExpBuffer(&query);
|
||||||
|
|
||||||
|
if (PQserverVersion(conn) >= 100000)
|
||||||
|
{
|
||||||
|
appendPQExpBufferStr(&query,
|
||||||
|
"SELECT pg_catalog.pg_wal_replay_resume()");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
appendPQExpBufferStr(&query,
|
||||||
|
"SELECT pg_catalog.pg_xlog_replay_resume()");
|
||||||
|
}
|
||||||
|
|
||||||
|
res = PQexec(conn, query.data);
|
||||||
|
|
||||||
|
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||||
|
{
|
||||||
|
log_db_error(conn, query.data, _("resume_wal_replay(): unable to resume WAL replay"));
|
||||||
|
success = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
termPQExpBuffer(&query);
|
||||||
|
PQclear(res);
|
||||||
|
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ===================== */
|
/* ===================== */
|
||||||
/* Node record functions */
|
/* Node record functions */
|
||||||
/* ===================== */
|
/* ===================== */
|
||||||
|
|||||||
@@ -440,6 +440,7 @@ ExtensionStatus get_repmgr_extension_status(PGconn *conn, t_extension_versions *
|
|||||||
void checkpoint(PGconn *conn);
|
void checkpoint(PGconn *conn);
|
||||||
bool vacuum_table(PGconn *conn, const char *table);
|
bool vacuum_table(PGconn *conn, const char *table);
|
||||||
bool promote_standby(PGconn *conn, bool wait, int wait_seconds);
|
bool promote_standby(PGconn *conn, bool wait, int wait_seconds);
|
||||||
|
bool resume_wal_replay(PGconn *conn);
|
||||||
|
|
||||||
/* node record functions */
|
/* node record functions */
|
||||||
t_server_type parse_node_type(const char *type);
|
t_server_type parse_node_type(const char *type);
|
||||||
|
|||||||
Reference in New Issue
Block a user