Re: Fixed pg_class refcache leak when the meta tuple in pg_class in invalid. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fixed pg_class refcache leak when the meta tuple in pg_class in invalid.
Date
Msg-id 1066.1480118278@sss.pgh.pa.us
Whole thread Raw
In response to Fixed pg_class refcache leak when the meta tuple in pg_class in invalid.  (Ming Li <mli@apache.org>)
Responses Re: Fixed pg_class refcache leak when the meta tuple in pg_class in invalid.  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
Ming Li <mli@apache.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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: confusing checkpoint_flush_after / bgwriter_flush_after
Next
From: Tom Lane
Date:
Subject: Re: References to arbitrary database objects that are suitable for pg_dump