Fix a relcache reference leak in stats collection.

In DistributedTablesSize() we didn't close the relations that had
replication factor > 2. This caused relcache reference leaks, and
warning messages like following in logs:

    WARNING:  relcache reference leak: relation "researchers" not closed
pull/1764/head
Hadi Moshayedi 2017-11-06 23:16:43 -05:00
parent 5984e7f009
commit 6d79d25101
1 changed files with 1 additions and 0 deletions

View File

@ -397,6 +397,7 @@ DistributedTablesSize(List *distTableOids)
if (PartitionMethod(relationId) == DISTRIBUTE_BY_HASH &&
!SingleReplicatedTable(relationId))
{
heap_close(relation, AccessShareLock);
continue;
}