summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavan Deolasee2016-03-15 13:15:21 +0000
committerPavan Deolasee2016-10-18 10:04:33 +0000
commit0867481eb5ebfdd6163d7f3b6d5420f93addf25a (patch)
tree53876812f92c083477b387c399cbcaef158c2a71
parent20af02aac8e56796d129d840b22f4131dca63cef (diff)
Rename RelationLocInfo->nodeList to RelationLocInfo->rl_nodeList to avoid using
such a common name for a very important structure member
-rw-r--r--src/backend/commands/tablecmds.c6
-rw-r--r--src/backend/commands/vacuum.c2
-rw-r--r--src/backend/optimizer/prep/preptlist.c2
-rw-r--r--src/backend/optimizer/util/pathnode.c6
-rw-r--r--src/backend/optimizer/util/pgxcship.c16
-rw-r--r--src/backend/parser/parse_utilcmd.c18
-rw-r--r--src/backend/pgxc/locator/locator.c24
-rw-r--r--src/backend/pgxc/locator/redistrib.c22
-rw-r--r--src/backend/pgxc/pool/execRemote.c2
-rw-r--r--src/include/pgxc/locator.h2
10 files changed, 50 insertions, 50 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index e43b76b83a..66cc09d65d 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -11540,8 +11540,8 @@ BuildRedistribCommands(Oid relid, List *subCmds)
*/
newLocInfo = CopyRelationLocInfo(oldLocInfo);
/* The node list of this locator information will be rebuilt after command scan */
- list_free(newLocInfo->nodeList);
- newLocInfo->nodeList = NULL;
+ list_free(newLocInfo->rl_nodeList);
+ newLocInfo->rl_nodeList = NULL;
/* Get the list to be modified */
new_num = get_pgxc_classnodes(RelationGetRelid(rel), &new_oid_array);
@@ -11593,7 +11593,7 @@ BuildRedistribCommands(Oid relid, List *subCmds)
/* Build relation node list for new locator info */
for (i = 0; i < new_num; i++)
- newLocInfo->nodeList = lappend_int(newLocInfo->nodeList,
+ newLocInfo->rl_nodeList = lappend_int(newLocInfo->rl_nodeList,
PGXCNodeGetNodeId(new_oid_array[i],
&node_type));
/* Build the command tree for table redistribution */
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index 5e3b1565cf..bc76a5d67a 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -1771,7 +1771,7 @@ vacuum_rel_coordinator(Relation onerel, bool is_outer)
{
int nindexes;
Relation *Irel;
- int nodes = list_length(RelationGetLocInfo(onerel)->nodeList);
+ int nodes = list_length(RelationGetLocInfo(onerel)->rl_nodeList);
vac_open_indexes(onerel, ShareUpdateExclusiveLock, &nindexes, &Irel);
hasindex = (nindexes > 0);
diff --git a/src/backend/optimizer/prep/preptlist.c b/src/backend/optimizer/prep/preptlist.c
index 50434cbd0f..1c0c9ad9cb 100644
--- a/src/backend/optimizer/prep/preptlist.c
+++ b/src/backend/optimizer/prep/preptlist.c
@@ -98,7 +98,7 @@ preprocess_targetlist(PlannerInfo *root, List *tlist)
ListCell *lc;
distribution->distributionType = rel_loc_info->locatorType;
- foreach(lc, rel_loc_info->nodeList)
+ foreach(lc, rel_loc_info->rl_nodeList)
distribution->nodes = bms_add_member(distribution->nodes,
lfirst_int(lc));
distribution->restrictNodes = NULL;
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c
index 3c5d6638bf..afd0aec5eb 100644
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -890,10 +890,10 @@ retry_pools:
int i;
bool healthmap[MaxDataNodes];
- PgxcNodeDnListHealth(rel_loc_info->nodeList, healthmap);
+ PgxcNodeDnListHealth(rel_loc_info->rl_nodeList, healthmap);
i = 0;
- foreach(lc, rel_loc_info->nodeList)
+ foreach(lc, rel_loc_info->rl_nodeList)
{
if (healthmap[i++] == true)
distribution->nodes = bms_add_member(distribution->nodes,
@@ -921,7 +921,7 @@ retry_pools:
}
else
{
- foreach(lc, rel_loc_info->nodeList)
+ foreach(lc, rel_loc_info->rl_nodeList)
distribution->nodes = bms_add_member(distribution->nodes,
lfirst_int(lc));
}
diff --git a/src/backend/optimizer/util/pgxcship.c b/src/backend/optimizer/util/pgxcship.c
index 7b7a4d181b..9dec6d6e0e 100644
--- a/src/backend/optimizer/util/pgxcship.c
+++ b/src/backend/optimizer/util/pgxcship.c
@@ -493,22 +493,22 @@ retry_pools:
ListCell *lc;
bool healthmap[MaxDataNodes];
- PgxcNodeDnListHealth(rel_loc_info->nodeList, healthmap);
+ PgxcNodeDnListHealth(rel_loc_info->rl_nodeList, healthmap);
i = 0;
- foreach(lc, rel_loc_info->nodeList)
+ foreach(lc, rel_loc_info->rl_nodeList)
{
if (!healthmap[i++])
newlist = lappend_int(newlist, lfirst_int(lc));
}
if (newlist != NIL)
- rel_loc_info->nodeList = list_difference_int(rel_loc_info->nodeList,
+ rel_loc_info->rl_nodeList = list_difference_int(rel_loc_info->rl_nodeList,
newlist);
/*
* If all nodes are down, cannot do much, just return NULL here
*/
- if (rel_loc_info->nodeList == NIL)
+ if (rel_loc_info->rl_nodeList == NIL)
{
/*
* Try an on-demand pool maintenance just to see if some nodes
@@ -518,7 +518,7 @@ retry_pools:
*/
if (retry)
{
- rel_loc_info->nodeList = newlist;
+ rel_loc_info->rl_nodeList = newlist;
newlist = NIL;
PoolPingNodes();
retry = false;
@@ -1709,7 +1709,7 @@ pgxc_check_index_shippability(RelationLocInfo *relLocInfo,
* Check if relation is distributed on a single node, in this case
* the constraint can be shipped in all the cases.
*/
- if (list_length(relLocInfo->nodeList) == 1)
+ if (list_length(relLocInfo->rl_nodeList) == 1)
return result;
/*
@@ -1917,8 +1917,8 @@ pgxc_check_fk_shippability(RelationLocInfo *parentLocInfo,
* Parent and child need to have their data located exactly
* on the same list of nodes.
*/
- if (list_difference_int(childLocInfo->nodeList, parentLocInfo->nodeList) ||
- list_difference_int(parentLocInfo->nodeList, childLocInfo->nodeList))
+ if (list_difference_int(childLocInfo->rl_nodeList, parentLocInfo->rl_nodeList) ||
+ list_difference_int(parentLocInfo->rl_nodeList, childLocInfo->rl_nodeList))
{
result = false;
break;
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index 3c460f8da7..0e899f1997 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -414,7 +414,7 @@ transformCreateStmt(CreateStmt *stmt, const char *queryString)
* Use defined node, if nothing defined get from the parent
*/
if (stmt->subcluster == NULL)
- stmt->subcluster = makeSubCluster(rel->rd_locator_info->nodeList);
+ stmt->subcluster = makeSubCluster(rel->rd_locator_info->rl_nodeList);
}
heap_close(rel, NoLock);
}
@@ -3406,7 +3406,7 @@ checkLocalFKConstraints(CreateStmtContext *cxt)
* Distribution nodes are defined, they must be a subset of
* the referenced relation's nodes
*/
- common = list_intersection_int(nodelist, rel_loc_info->nodeList);
+ common = list_intersection_int(nodelist, rel_loc_info->rl_nodeList);
if (list_length(common) < list_length(nodelist))
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
@@ -3418,7 +3418,7 @@ checkLocalFKConstraints(CreateStmtContext *cxt)
/* suggest distribution */
if (nodelist)
{
- common = list_intersection_int(nodelist, rel_loc_info->nodeList);
+ common = list_intersection_int(nodelist, rel_loc_info->rl_nodeList);
if (list_length(common) == 0)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
@@ -3427,7 +3427,7 @@ checkLocalFKConstraints(CreateStmtContext *cxt)
nodelist = common;
}
else
- nodelist = rel_loc_info? list_copy(rel_loc_info->nodeList):NIL;
+ nodelist = rel_loc_info? list_copy(rel_loc_info->rl_nodeList):NIL;
}
}
else if (rel_loc_info->locatorType == LOCATOR_TYPE_RROBIN)
@@ -3451,8 +3451,8 @@ checkLocalFKConstraints(CreateStmtContext *cxt)
*/
if (cxt->subcluster)
{
- common = list_intersection_int(nodelist, rel_loc_info->nodeList);
- if (list_length(common) != list_length(rel_loc_info->nodeList) ||
+ common = list_intersection_int(nodelist, rel_loc_info->rl_nodeList);
+ if (list_length(common) != list_length(rel_loc_info->rl_nodeList) ||
list_length(common) != list_length(nodelist))
{
if (list_length(common) == 0)
@@ -3466,8 +3466,8 @@ checkLocalFKConstraints(CreateStmtContext *cxt)
{
if (nodelist)
{
- common = list_intersection_int(nodelist, rel_loc_info->nodeList);
- if (list_length(common) != list_length(rel_loc_info->nodeList))
+ common = list_intersection_int(nodelist, rel_loc_info->rl_nodeList);
+ if (list_length(common) != list_length(rel_loc_info->rl_nodeList))
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("referenced HASH/MODULO table must be defined on same nodes")));
@@ -3475,7 +3475,7 @@ checkLocalFKConstraints(CreateStmtContext *cxt)
nodelist = common;
}
else
- nodelist = list_copy(rel_loc_info->nodeList);
+ nodelist = list_copy(rel_loc_info->rl_nodeList);
/* Now define the subcluster */
cxt->subcluster = makeSubCluster(nodelist);
}
diff --git a/src/backend/pgxc/locator/locator.c b/src/backend/pgxc/locator/locator.c
index 79a307420e..c45d7e7d14 100644
--- a/src/backend/pgxc/locator/locator.c
+++ b/src/backend/pgxc/locator/locator.c
@@ -503,7 +503,7 @@ GetRoundRobinNode(Oid relid)
rel->rd_locator_info->roundRobinNode = rel->rd_locator_info->roundRobinNode->next;
else
/* reset to first one */
- rel->rd_locator_info->roundRobinNode = rel->rd_locator_info->nodeList->head;
+ rel->rd_locator_info->roundRobinNode = rel->rd_locator_info->rl_nodeList->head;
relation_close(rel, AccessShareLock);
@@ -522,10 +522,10 @@ IsTableDistOnPrimary(RelationLocInfo *rel_loc_info)
if (!OidIsValid(primary_data_node) ||
rel_loc_info == NULL ||
- list_length(rel_loc_info->nodeList = 0))
+ list_length(rel_loc_info->rl_nodeList = 0))
return false;
- foreach(item, rel_loc_info->nodeList)
+ foreach(item, rel_loc_info->rl_nodeList)
{
char ntype = PGXC_NODE_DATANODE;
if (PGXCNodeGetNodeId(primary_data_node, &ntype) == lfirst_int(item))
@@ -545,8 +545,8 @@ IsLocatorInfoEqual(RelationLocInfo *rel_loc_info1, RelationLocInfo *rel_loc_info
List *nodeList1, *nodeList2;
Assert(rel_loc_info1 && rel_loc_info2);
- nodeList1 = rel_loc_info1->nodeList;
- nodeList2 = rel_loc_info2->nodeList;
+ nodeList1 = rel_loc_info1->rl_nodeList;
+ nodeList2 = rel_loc_info2->rl_nodeList;
/* Same relation? */
if (rel_loc_info1->relid != rel_loc_info2->relid)
@@ -713,13 +713,13 @@ RelationBuildLocator(Relation rel)
relationLocInfo->partAttrName = get_attname(relationLocInfo->relid, pgxc_class->pcattnum);
- relationLocInfo->nodeList = NIL;
+ relationLocInfo->rl_nodeList = NIL;
for (j = 0; j < pgxc_class->nodeoids.dim1; j++)
{
char ntype = PGXC_NODE_DATANODE;
int nid = PGXCNodeGetNodeId(pgxc_class->nodeoids.values[j], &ntype);
- relationLocInfo->nodeList = lappend_int(relationLocInfo->nodeList, nid);
+ relationLocInfo->rl_nodeList = lappend_int(relationLocInfo->rl_nodeList, nid);
}
/*
@@ -735,10 +735,10 @@ RelationBuildLocator(Relation rel)
* pick a random one to start with,
* since each process will do this independently
*/
- offset = compute_modulo(abs(rand()), list_length(relationLocInfo->nodeList));
+ offset = compute_modulo(abs(rand()), list_length(relationLocInfo->rl_nodeList));
srand(time(NULL));
- relationLocInfo->roundRobinNode = relationLocInfo->nodeList->head; /* initialize */
+ relationLocInfo->roundRobinNode = relationLocInfo->rl_nodeList->head; /* initialize */
for (j = 0; j < offset && relationLocInfo->roundRobinNode->next != NULL; j++)
relationLocInfo->roundRobinNode = relationLocInfo->roundRobinNode->next;
}
@@ -801,8 +801,8 @@ CopyRelationLocInfo(RelationLocInfo * src_info)
if (src_info->partAttrName)
dest_info->partAttrName = pstrdup(src_info->partAttrName);
- if (src_info->nodeList)
- dest_info->nodeList = list_copy(src_info->nodeList);
+ if (src_info->rl_nodeList)
+ dest_info->rl_nodeList = list_copy(src_info->rl_nodeList);
/* Note, for round robin, we use the relcache entry */
return dest_info;
@@ -1625,7 +1625,7 @@ GetRelationNodes(RelationLocInfo *rel_loc_info, Datum valueForDistCol,
typeOfValueForDistCol,
LOCATOR_LIST_LIST,
0,
- (void *)rel_loc_info->nodeList,
+ (void *)rel_loc_info->rl_nodeList,
(void **)&nodenums,
false);
count = GET_NODES(locator, valueForDistCol, isValueNull, NULL);
diff --git a/src/backend/pgxc/locator/redistrib.c b/src/backend/pgxc/locator/redistrib.c
index 49a2665694..200d6424dc 100644
--- a/src/backend/pgxc/locator/redistrib.c
+++ b/src/backend/pgxc/locator/redistrib.c
@@ -164,10 +164,10 @@ pgxc_redist_build_replicate_to_distrib(RedistribState *distribState,
return;
/* Get the list of nodes that are added to the relation */
- removedNodes = list_difference_int(oldLocInfo->nodeList, newLocInfo->nodeList);
+ removedNodes = list_difference_int(oldLocInfo->rl_nodeList, newLocInfo->rl_nodeList);
/* Get the list of nodes that are removed from relation */
- newNodes = list_difference_int(newLocInfo->nodeList, oldLocInfo->nodeList);
+ newNodes = list_difference_int(newLocInfo->rl_nodeList, oldLocInfo->rl_nodeList);
/*
* If some nodes are added, turn back to default, we need to fetch data
@@ -190,7 +190,7 @@ pgxc_redist_build_replicate_to_distrib(RedistribState *distribState,
* If the table is redistributed to a single node, a TRUNCATE on removed nodes
* is sufficient so leave here.
*/
- if (list_length(newLocInfo->nodeList) == 1)
+ if (list_length(newLocInfo->rl_nodeList) == 1)
{
/* Add REINDEX command if necessary */
pgxc_redist_add_reindex(distribState);
@@ -205,14 +205,14 @@ pgxc_redist_build_replicate_to_distrib(RedistribState *distribState,
if (newLocInfo->locatorType == LOCATOR_TYPE_HASH)
{
ExecNodes *execNodes = makeNode(ExecNodes);
- execNodes->nodeList = newLocInfo->nodeList;
+ execNodes->nodeList = newLocInfo->rl_nodeList;
distribState->commands = lappend(distribState->commands,
makeRedistribCommand(DISTRIB_DELETE_HASH, CATALOG_UPDATE_AFTER, execNodes));
}
else if (newLocInfo->locatorType == LOCATOR_TYPE_MODULO)
{
ExecNodes *execNodes = makeNode(ExecNodes);
- execNodes->nodeList = newLocInfo->nodeList;
+ execNodes->nodeList = newLocInfo->rl_nodeList;
distribState->commands = lappend(distribState->commands,
makeRedistribCommand(DISTRIB_DELETE_MODULO, CATALOG_UPDATE_AFTER, execNodes));
}
@@ -248,10 +248,10 @@ pgxc_redist_build_replicate(RedistribState *distribState,
return;
/* Get the list of nodes that are added to the relation */
- removedNodes = list_difference_int(oldLocInfo->nodeList, newLocInfo->nodeList);
+ removedNodes = list_difference_int(oldLocInfo->rl_nodeList, newLocInfo->rl_nodeList);
/* Get the list of nodes that are removed from relation */
- newNodes = list_difference_int(newLocInfo->nodeList, oldLocInfo->nodeList);
+ newNodes = list_difference_int(newLocInfo->rl_nodeList, oldLocInfo->rl_nodeList);
/*
* If nodes have to be added, we need to fetch data for redistribution first.
@@ -475,7 +475,7 @@ distrib_copy_from(RedistribState *distribState, ExecNodes *exec_nodes)
if (exec_nodes)
{
if (exec_nodes->nodeList)
- copyState->rel_loc->nodeList = exec_nodes->nodeList;
+ copyState->rel_loc->rl_nodeList = exec_nodes->nodeList;
}
tupdesc = RelationGetDescr(rel);
@@ -736,7 +736,7 @@ distrib_delete_hash(RedistribState *distribState, ExecNodes *exec_nodes)
* Find the correct node position in node list of locator information.
* So scan the node list and fetch the position of node.
*/
- foreach(item2, locinfo->nodeList)
+ foreach(item2, locinfo->rl_nodeList)
{
int loc = lfirst_int(item2);
if (loc == nodenum)
@@ -759,10 +759,10 @@ distrib_delete_hash(RedistribState *distribState, ExecNodes *exec_nodes)
if (hashfuncname)
appendStringInfo(buf2, "%s WHERE abs(%s(%s)) %% %d != %d",
buf->data, hashfuncname, colname,
- list_length(locinfo->nodeList), nodepos);
+ list_length(locinfo->rl_nodeList), nodepos);
else
appendStringInfo(buf2, "%s WHERE abs(%s) %% %d != %d", buf->data, colname,
- list_length(locinfo->nodeList), nodepos);
+ list_length(locinfo->rl_nodeList), nodepos);
/* Then launch this single query */
distrib_execute_query(buf2->data, IsTempTable(relOid), local_exec_nodes);
diff --git a/src/backend/pgxc/pool/execRemote.c b/src/backend/pgxc/pool/execRemote.c
index 8171f08912..a15f21dccd 100644
--- a/src/backend/pgxc/pool/execRemote.c
+++ b/src/backend/pgxc/pool/execRemote.c
@@ -2740,7 +2740,7 @@ void
DataNodeCopyBegin(RemoteCopyData *rcstate)
{
int i;
- List *nodelist = rcstate->rel_loc->nodeList;
+ List *nodelist = rcstate->rel_loc->rl_nodeList;
PGXCNodeHandle **connections;
bool need_tran_block;
GlobalTransactionId gxid;
diff --git a/src/include/pgxc/locator.h b/src/include/pgxc/locator.h
index dd4892da02..5062cebe83 100644
--- a/src/include/pgxc/locator.h
+++ b/src/include/pgxc/locator.h
@@ -65,7 +65,7 @@ typedef struct
char locatorType;
PartAttrNumber partAttrNum; /* if partitioned */
char *partAttrName; /* if partitioned */
- List *nodeList; /* Node Indices */
+ List *rl_nodeList; /* Node Indices */
ListCell *roundRobinNode; /* index of the next one to use */
} RelationLocInfo;