Re: Fixed pg_class refcache leak when the meta tuple in pg_class in invalid.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ming Li <mli(at)apache(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fixed pg_class refcache leak when the meta tuple in pg_class in invalid.
Date: 2016-11-25 23:57:58
Message-ID: 1066.1480118278@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ming Li <mli(at)apache(dot)org> writes:
> In some cases the meta tuple in pg_class for a specific relation is
> invalid, which will cause relcache leak, and then report warning:
> WARNING: relcache reference leak: relation "pg_class" not closed.

> The diff file in the attachment can fix this problem.

I'm confused. RelationBuildDesc doesn't open pg_class and shouldn't
be responsible for closing it either; both of those things happen in
ScanPgRelation, leaving no apparent scope for a leak such as you suggest.
Moreover, there's no variable named pg_class_relation in this whole file,
so your patch wouldn't even compile.

Could you show us a test case that provokes the warning you see?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-11-26 00:00:40 Re: References to arbitrary database objects that are suitable for pg_dump
Previous Message Tom Lane 2016-11-25 23:39:13 Re: confusing checkpoint_flush_after / bgwriter_flush_after