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