Refactor: DistributedTableSize more explicitly only locks pg_dist_node

pull/1519/head
Brian Cloutier 2017-08-03 11:02:52 +03:00 committed by Brian Cloutier
parent 3769381366
commit f87fefa323
1 changed files with 1 additions and 3 deletions

View File

@ -158,7 +158,6 @@ static uint64
DistributedTableSize(Oid relationId, char *sizeQuery)
{
Relation relation = NULL;
Relation pgDistNode = NULL;
List *workerNodeList = NULL;
ListCell *workerNodeCell = NULL;
uint64 totalRelationSize = 0;
@ -175,7 +174,7 @@ DistributedTableSize(Oid relationId, char *sizeQuery)
ErrorIfNotSuitableToGetSize(relationId);
pgDistNode = heap_open(DistNodeRelationId(), AccessShareLock);
LockRelationOid(DistNodeRelationId(), AccessShareLock);
workerNodeList = ActivePrimaryNodeList();
@ -187,7 +186,6 @@ DistributedTableSize(Oid relationId, char *sizeQuery)
totalRelationSize += relationSizeOnNode;
}
heap_close(pgDistNode, NoLock);
heap_close(relation, AccessShareLock);
return totalRelationSize;