Repository: incubator-hawq Updated Branches: refs/heads/master 7daee4002 -> 76dc63191
HAWQ-566. Fix analyze and truncate hung. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/76dc6319 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/76dc6319 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/76dc6319 Branch: refs/heads/master Commit: 76dc63191fb21b1321c00f00954afc1cb98c6f45 Parents: 7daee40 Author: hzhang2 <zhanghuan...@163.com> Authored: Mon Mar 21 16:38:15 2016 +0800 Committer: hzhang2 <zhanghuan...@163.com> Committed: Mon Mar 21 16:38:15 2016 +0800 ---------------------------------------------------------------------- src/backend/commands/analyze.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/76dc6319/src/backend/commands/analyze.c ---------------------------------------------------------------------- diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 32b3416..ac12837 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -828,7 +828,7 @@ static int calculate_virtual_segment_number(List* candidateOids) { candidateOid = lfirst_oid(le1); //Relation rel = (Relation)lfirst(le1); - Relation rel = relation_open(candidateOid, AccessShareLock); + Relation rel = relation_open(candidateOid, ShareUpdateExclusiveLock); if (candidateOid > 0 ) { GpPolicy *targetPolicy = GpPolicyFetch(CurrentMemoryContext, candidateOid); @@ -848,7 +848,7 @@ static int calculate_virtual_segment_number(List* candidateOids) { totalDataSize += calculate_relation_size(rel); } } - relation_close(rel, AccessShareLock); + relation_close(rel, NoLock); } if (isHashRelationExist) {