mirror of https://github.com/citusdata/citus.git
Refactor: DistributedTableSize more explicitly only locks pg_dist_node
parent
3769381366
commit
f87fefa323
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue