summaryrefslogtreecommitdiff
path: root/src/rewrite
diff options
context:
space:
mode:
authorTatsuo Ishii2020-09-17 04:41:44 +0000
committerTatsuo Ishii2020-09-17 10:00:49 +0000
commit9e366c14e75aedfa3357e71800d6e3ac9847a39a (patch)
treebb4e6b6fa84a9cb4535eddf5a5b114f277f2d511 /src/rewrite
parent5073187d401e8df26a18dce541aaa68736a7bd46 (diff)
Apply language cleanup mega patch.
black/white_function_list -> write_function_list, read_only_function_list black_query_pattern -> primay_routing_query_pattern black/white_memqcache_table_list -> cache_unsafe/cache_safe_table_list Watchdog: replace master to 'leader' for 'master' watchdog nodes ALWAYS_MASTER flag is changed to ALWAYS_PRIMARY. Replace relcache_query_target option 'master' to 'primary'. Replace Master Node with Main node ( node id with 0 or youngest live ). Replace follow_master with follow_primary with parameters. Replace some remaining occurrences of master with primary/main/leader Patch contributed by: Umar Hayat Reviewed by me:
Diffstat (limited to 'src/rewrite')
-rw-r--r--src/rewrite/pool_lobj.c12
-rw-r--r--src/rewrite/pool_timestamp.c6
2 files changed, 9 insertions, 9 deletions
diff --git a/src/rewrite/pool_lobj.c b/src/rewrite/pool_lobj.c
index 01e50a86f..38187fe14 100644
--- a/src/rewrite/pool_lobj.c
+++ b/src/rewrite/pool_lobj.c
@@ -172,9 +172,9 @@ pool_rewrite_lo_creat(char kind, char *packet, int packet_len,
*/
/* issue lock table command to lob_lock_table */
snprintf(qbuf, sizeof(qbuf), "LOCK TABLE %s IN SHARE ROW EXCLUSIVE MODE", pool_config->lobj_lock_table);
- per_node_statement_log(backend, MASTER_NODE_ID, qbuf);
- status = do_command(frontend, MASTER(backend), qbuf, MAJOR(backend), MASTER_CONNECTION(backend)->pid,
- MASTER_CONNECTION(backend)->key, 0);
+ per_node_statement_log(backend, MAIN_NODE_ID, qbuf);
+ status = do_command(frontend, MAIN(backend), qbuf, MAJOR(backend), MAIN_CONNECTION(backend)->pid,
+ MAIN_CONNECTION(backend)->key, 0);
if (status == POOL_END)
{
ereport(WARNING,
@@ -185,7 +185,7 @@ pool_rewrite_lo_creat(char kind, char *packet, int packet_len,
/*
* If transaction state is E, do_command failed to execute command
*/
- if (TSTATE(backend, MASTER_NODE_ID) == 'E')
+ if (TSTATE(backend, MAIN_NODE_ID) == 'E')
{
ereport(LOG,
(errmsg("failed while rewriting LO CREATE"),
@@ -194,8 +194,8 @@ pool_rewrite_lo_creat(char kind, char *packet, int packet_len,
}
/* get max lobj id */
- per_node_statement_log(backend, MASTER_NODE_ID, GET_MAX_LOBJ_KEY);
- do_query(MASTER(backend), GET_MAX_LOBJ_KEY, &result, MAJOR(backend));
+ per_node_statement_log(backend, MAIN_NODE_ID, GET_MAX_LOBJ_KEY);
+ do_query(MAIN(backend), GET_MAX_LOBJ_KEY, &result, MAJOR(backend));
if (!result)
{
diff --git a/src/rewrite/pool_timestamp.c b/src/rewrite/pool_timestamp.c
index 58ef5f68a..f218c4289 100644
--- a/src/rewrite/pool_timestamp.c
+++ b/src/rewrite/pool_timestamp.c
@@ -478,7 +478,7 @@ rewrite_timestamp_walker(Node *node, void *context)
/*
- * Get `now()' from MASTER node
+ * Get `now()' from MAIN node
*/
static char *
get_current_timestamp(POOL_CONNECTION_POOL * backend)
@@ -486,7 +486,7 @@ get_current_timestamp(POOL_CONNECTION_POOL * backend)
POOL_SELECT_RESULT *res;
static char timestamp[64];
- do_query(MASTER(backend), "SELECT now()", &res, MAJOR(backend));
+ do_query(MAIN(backend), "SELECT now()", &res, MAJOR(backend));
if (res->numrows != 1)
{
@@ -1227,7 +1227,7 @@ makeStringConstFromQuery(POOL_CONNECTION_POOL * backend, char *expression)
char *str;
snprintf(query, sizeof(query), "SELECT %s", expression);
- do_query(MASTER(backend), query, &res, MAJOR(backend));
+ do_query(MAIN(backend), query, &res, MAJOR(backend));
if (res->numrows != 1)
{