mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 16:46:28 +00:00
primary -> master
For consistency.
This commit is contained in:
12
dbutils.c
12
dbutils.c
@@ -210,11 +210,11 @@ get_primary_node_id(PGconn *conn, char *cluster)
|
|||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
sqlquery_snprintf(sqlquery,
|
sqlquery_snprintf(sqlquery,
|
||||||
"SELECT id "
|
"SELECT id "
|
||||||
" FROM %s.repl_nodes "
|
" FROM %s.repl_nodes "
|
||||||
" WHERE cluster = '%s' "
|
" WHERE cluster = '%s' "
|
||||||
" AND type = 'primary' "
|
" AND type = 'master' "
|
||||||
" AND active IS TRUE ",
|
" AND active IS TRUE ",
|
||||||
get_repmgr_schema_quoted(conn),
|
get_repmgr_schema_quoted(conn),
|
||||||
cluster);
|
cluster);
|
||||||
|
|
||||||
@@ -440,7 +440,7 @@ get_primary_connection(PGconn *standby_conn, char *cluster,
|
|||||||
" SELECT n.conninfo, n.name, n.id "
|
" SELECT n.conninfo, n.name, n.id "
|
||||||
" FROM %s.repl_nodes n "
|
" FROM %s.repl_nodes n "
|
||||||
" WHERE n.cluster = '%s' "
|
" WHERE n.cluster = '%s' "
|
||||||
" AND n.type = 'primary' ",
|
" AND n.type = 'master' ",
|
||||||
get_repmgr_schema_quoted(standby_conn),
|
get_repmgr_schema_quoted(standby_conn),
|
||||||
cluster);
|
cluster);
|
||||||
|
|
||||||
|
|||||||
27
repmgr.c
27
repmgr.c
@@ -760,7 +760,7 @@ do_master_register(void)
|
|||||||
record_created = create_node_record(conn,
|
record_created = create_node_record(conn,
|
||||||
"master register",
|
"master register",
|
||||||
options.node,
|
options.node,
|
||||||
"primary",
|
"master",
|
||||||
NO_UPSTREAM_NODE,
|
NO_UPSTREAM_NODE,
|
||||||
options.cluster_name,
|
options.cluster_name,
|
||||||
options.node_name,
|
options.node_name,
|
||||||
@@ -2461,7 +2461,7 @@ create_schema(PGconn *conn)
|
|||||||
sqlquery_snprintf(sqlquery,
|
sqlquery_snprintf(sqlquery,
|
||||||
"CREATE TABLE %s.repl_nodes ( "
|
"CREATE TABLE %s.repl_nodes ( "
|
||||||
" id INTEGER PRIMARY KEY, "
|
" id INTEGER PRIMARY KEY, "
|
||||||
" type TEXT NOT NULL CHECK (type IN('primary','standby','witness')), "
|
" type TEXT NOT NULL CHECK (type IN('master','standby','witness')), "
|
||||||
" upstream_node_id INTEGER NULL REFERENCES %s.repl_nodes (id), "
|
" upstream_node_id INTEGER NULL REFERENCES %s.repl_nodes (id), "
|
||||||
" cluster TEXT NOT NULL, "
|
" cluster TEXT NOT NULL, "
|
||||||
" name TEXT NOT NULL, "
|
" name TEXT NOT NULL, "
|
||||||
@@ -2556,29 +2556,6 @@ create_schema(PGconn *conn)
|
|||||||
}
|
}
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
|
|
||||||
/* repl_events */
|
|
||||||
sqlquery_snprintf(sqlquery,
|
|
||||||
"CREATE TABLE %s.repl_events ( "
|
|
||||||
" node_id INTEGER NOT NULL, "
|
|
||||||
" event TEXT NOT NULL, "
|
|
||||||
" successful BOOLEAN NOT NULL DEFAULT TRUE, "
|
|
||||||
" event_timestamp TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, "
|
|
||||||
" details TEXT NULL "
|
|
||||||
" ) ",
|
|
||||||
get_repmgr_schema_quoted(conn));
|
|
||||||
|
|
||||||
log_debug(_("master register: %s\n"), sqlquery);
|
|
||||||
res = PQexec(conn, sqlquery);
|
|
||||||
if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
|
|
||||||
{
|
|
||||||
log_err(_("unable to create table '%s.repl_events': %s\n"),
|
|
||||||
get_repmgr_schema_quoted(conn), PQerrorMessage(conn));
|
|
||||||
PQfinish(conn);
|
|
||||||
exit(ERR_BAD_CONFIG);
|
|
||||||
}
|
|
||||||
PQclear(res);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XXX Here we MUST try to load the repmgr_function.sql not hardcode it
|
* XXX Here we MUST try to load the repmgr_function.sql not hardcode it
|
||||||
* here
|
* here
|
||||||
|
|||||||
12
repmgrd.c
12
repmgrd.c
@@ -814,7 +814,7 @@ standby_monitor(void)
|
|||||||
sprintf(sqlquery,
|
sprintf(sqlquery,
|
||||||
"SELECT id "
|
"SELECT id "
|
||||||
" FROM %s.repl_nodes "
|
" FROM %s.repl_nodes "
|
||||||
" WHERE type = 'primary' "
|
" WHERE type = 'master' "
|
||||||
" AND active IS TRUE ",
|
" AND active IS TRUE ",
|
||||||
get_repmgr_schema_quoted(my_local_conn));
|
get_repmgr_schema_quoted(my_local_conn));
|
||||||
|
|
||||||
@@ -1492,9 +1492,9 @@ do_upstream_standby_failover(t_node_info upstream_node)
|
|||||||
* provide an option to either try and find the current primary and/or
|
* provide an option to either try and find the current primary and/or
|
||||||
* a strategy to connect to a different upstream node
|
* a strategy to connect to a different upstream node
|
||||||
*/
|
*/
|
||||||
if(strcmp(PQgetvalue(res, 0, 4), "primary") == 0)
|
if(strcmp(PQgetvalue(res, 0, 4), "master") == 0)
|
||||||
{
|
{
|
||||||
log_err(_("unable to find active upstream node\n"));
|
log_err(_("unable to find active master node\n"));
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1613,7 +1613,7 @@ set_local_node_failed(void)
|
|||||||
sqlquery_snprintf(sqlquery,
|
sqlquery_snprintf(sqlquery,
|
||||||
"SELECT id, conninfo "
|
"SELECT id, conninfo "
|
||||||
" FROM %s.repl_nodes "
|
" FROM %s.repl_nodes "
|
||||||
" WHERE type = 'primary' "
|
" WHERE type = 'master' "
|
||||||
" AND active IS TRUE ",
|
" AND active IS TRUE ",
|
||||||
get_repmgr_schema_quoted(primary_conn));
|
get_repmgr_schema_quoted(primary_conn));
|
||||||
|
|
||||||
@@ -2110,7 +2110,7 @@ get_node_info(PGconn *conn, char *cluster, int node_id)
|
|||||||
static t_server_type
|
static t_server_type
|
||||||
parse_node_type(const char *type)
|
parse_node_type(const char *type)
|
||||||
{
|
{
|
||||||
if(strcmp(type, "primary") == 0)
|
if(strcmp(type, "master") == 0)
|
||||||
{
|
{
|
||||||
return PRIMARY;
|
return PRIMARY;
|
||||||
}
|
}
|
||||||
@@ -2174,7 +2174,7 @@ update_node_record_set_primary(PGconn *conn, int this_node_id, int old_primary_n
|
|||||||
|
|
||||||
sqlquery_snprintf(sqlquery,
|
sqlquery_snprintf(sqlquery,
|
||||||
" UPDATE %s.repl_nodes "
|
" UPDATE %s.repl_nodes "
|
||||||
" SET type = 'primary', "
|
" SET type = 'master', "
|
||||||
" upstream_node_id = NULL "
|
" upstream_node_id = NULL "
|
||||||
" WHERE cluster = '%s' "
|
" WHERE cluster = '%s' "
|
||||||
" AND id = %i ",
|
" AND id = %i ",
|
||||||
|
|||||||
Reference in New Issue
Block a user