Rename RelationLocInfo->nodeList to RelationLocInfo->rl_nodeList to avoid using
authorPavan Deolasee <[email protected]>
Tue, 15 Mar 2016 13:15:21 +0000 (18:45 +0530)
committerPavan Deolasee <[email protected]>
Tue, 15 Mar 2016 13:15:21 +0000 (18:45 +0530)
such a common name for a very important structure member

src/backend/commands/tablecmds.c
src/backend/commands/vacuum.c
src/backend/optimizer/prep/preptlist.c
src/backend/optimizer/util/pathnode.c
src/backend/optimizer/util/pgxcship.c
src/backend/parser/parse_utilcmd.c
src/backend/pgxc/locator/locator.c
src/backend/pgxc/locator/redistrib.c
src/backend/pgxc/pool/execRemote.c
src/include/pgxc/locator.h

index 49db8ff58dea435142277c25dc30a62f685836e8..5dcf7146562ad80d3ce706c5f9041c3550d57399 100644 (file)
@@ -11675,8 +11675,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);
@@ -11728,7 +11728,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 */
index 2533e366c3adb6eea66e8b893aea2d7441d29064..aa5bf9799a12eb92fdfd1b5be304631e286763a7 100644 (file)
@@ -1774,7 +1774,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);
index 50434cbd0f9d0cdbb11a5d7c4cf20c564dc4a237..1c0c9ad9cbd673bec3bb9398334d7e7d828a2c9b 100644 (file)
@@ -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;
index f9efa9ff8b305c26c9e3babc8b4b24ec280db206..0bc2978102e70640b18cad694e8deff8248db38b 100644 (file)
@@ -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));
                }
index d943b63b0f5739fc07cc05a5cae49c3677e279f9..d1d377f3b3d6b491f9413512f738f473db8d1a0e 100644 (file)
@@ -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;
@@ -1713,7 +1713,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;
 
        /*
@@ -1921,8 +1921,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;
index 3c460f8da7641c3bed8953d61c19383d6ea33a7c..0e899f1997716103013a78d48598d822a0869c57 100644 (file)
@@ -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);
                        }
index 79a307420eee5f834d16e5e5d40a465fd0dcd878..c45d7e7d146500cc76f1a71d000e973afdca479a 100644 (file)
@@ -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);
index 49a2665694b2007f26f1ca1710b5de7fef8f64be..200d6424dc6117dfa00d4b81b2c7b47dbd514a1b 100644 (file)
@@ -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);
index 42abd29171b6ecac31d036196116bdd017604664..e277a77f0b670473cd716d20c1dca68c649239f2 100644 (file)
@@ -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;
index dd4892da02e51b0ce11020999fe9babbc65ff097..5062cebe8311760e839bbb41fdae7b52749d0621 100644 (file)
@@ -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;