提交 0167e360 编写于 作者: P Paul Guo 提交者: Paul Guo

Remove a rowmark/junk_filter related FIXME in ExecInitModifyTable()

Checked our previous GPDB hacking code and newest implementation.
I found that previous gpdb related diffs do not seem to apply to
current gpdb code. So removing the FIXME. This patch also slightly
refactors some code and changes some other existing comments.
上级 f4489db1
......@@ -171,11 +171,7 @@ GpPolicyIsReplicated(const GpPolicy *policy)
bool
GpPolicyIsPartitioned(const GpPolicy *policy)
{
if (policy == NULL)
return false;
return GpPolicyIsHashPartitioned(policy) ||
GpPolicyIsRandomPartitioned(policy);
return (policy != NULL && policy->ptype == POLICYTYPE_PARTITIONED);
}
bool
......
......@@ -1848,12 +1848,10 @@ InitPlan(QueryDesc *queryDesc, int eflags)
switch (rc->markType)
{
case ROW_MARK_TABLE_EXCLUSIVE:
/* CDB: On QD, lock whole table in X mode, if distributed ao able. */
relid = getrelid(rc->rti, rangeTable);
relation = heap_open(relid, ExclusiveLock);
break;
case ROW_MARK_TABLE_SHARE:
/* CDB: On QD, lock whole table in S mode, if distributed. */
relid = getrelid(rc->rti, rangeTable);
relation = heap_open(relid, RowShareLock);
break;
......
......@@ -1813,8 +1813,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
if (rte->rtekind == RTE_RELATION)
{
Relation relation = heap_open(rte->relid, NoLock);
if (relation->rd_cdbpolicy &&
relation->rd_cdbpolicy->ptype == POLICYTYPE_PARTITIONED)
if (GpPolicyIsPartitioned(relation->rd_cdbpolicy))
isdistributed = true;
heap_close(relation, NoLock);
if (isdistributed)
......@@ -1845,14 +1844,6 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
}
}
/* GPDB_90_MERGE_FIXME: This code was heavily refactored in the merge.
* This used to be in ExecInsert, in execMain.c. It was also heavily
* modified in GPDB, to handle rowmarks differently, and to disable
* some sanity checks for ORCA. I did not copy over those GPDB changes,
* because I wasn't sure how, and wasn't sure which of the changes
* were still needed.
*/
/* select first subplan */
mtstate->mt_whichplan = 0;
subplan = (Plan *) linitial(node->plans);
......
......@@ -2788,6 +2788,8 @@ grouping_planner(PlannerInfo *root, double tuple_fraction)
* The reason is that gpdb is an MPP database, the result tuples may not be on
* the same segment. And for cursor statement, reader gang cannot get Xid to lock
* the tuples. (More details: https://groups.google.com/a/greenplum.org/forum/#!topic/gpdb-dev/p-6_dNjnRMQ)
* Upgrading the lock mode (see below) for distributed table is probably
* not needed for all the cases and we may want to enhance this later.
*/
foreach(lc, root->rowMarks)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册