From: Mark Dilger <hornschnorter@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org, Tomas Vondra <tomas.vondra@2ndquadrant.com>
Subject: Re: Missing dependency tracking for TableFunc nodes
Date: Wed, 13 Nov 2019 15:00:03 -0800
Message-ID: <997cbcae-7739-f871-84a0-1192380abb54@gmail.com> (raw)
In-Reply-To: <18427.1573508501@sss.pgh.pa.us>
References: <18427.1573508501@sss.pgh.pa.us>
On 11/11/19 1:41 PM, Tom Lane wrote:
> I happened to notice that find_expr_references_walker has not
> been taught anything about TableFunc nodes, which means it will
> miss the type and collation OIDs embedded in such a node.
>
> This can be demonstrated to be a problem by the attached script,
> which will end up with a "cache lookup failed for type NNNNN"
> error because we allow dropping a type the XMLTABLE construct
> references.
>
> This isn't hard to fix, as per the attached patch, but it makes
> me nervous. I wonder what other dependencies we might be missing.
I can consistently generate errors like the following in master:
ERROR: cache lookup failed for statistics object 31041
This happens in a stress test in which multiple processes are making
changes to the schema. So far, all the sessions that report this cache
lookup error do so when performing one of ANALYZE, VACUUM ANALYZE,
UPDATE, DELETE or EXPLAIN ANALYZE on a table that has MCV statistics.
All processes running simultaneously are running the same set of
functions, which create and delete tables, indexes, and statistics
objects, insert, update, and delete rows in those tables, etc.
The fact that the statistics are of the MCV type might not be relevant;
I'm creating those on tables as part of testing Tomas Vondra's MCV
statistics patch, so all the tables have statistics of that kind on them.
I can try to distill my test case a bit, but first I'd like to know if
you are interested. Currently, the patch is over 2.2MB, gzip'd. I'll
only bother distilling it if you don't already know about these cache
lookup failures.
--
Mark Dilger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: hornschnorter@gmail.com, tgl@sss.pgh.pa.us, tomas.vondra@2ndquadrant.com
Subject: Re: Missing dependency tracking for TableFunc nodes
In-Reply-To: <997cbcae-7739-f871-84a0-1192380abb54@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox