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