Re: BUG #15350: Getting invalid cache ID: 11 Errors

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kieran McCusker <kieran(dot)mccusker(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15350: Getting invalid cache ID: 11 Errors
Date: 2018-08-29 22:45:43
Message-ID: CAEepm=1C3Oc-H2vju86_9SiW1-gUyZ2CnAL8tM4us3mSNUS2xw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Aug 28, 2018 at 2:40 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com> writes:
> > We could probably improve that situation by making syscache lookups
> > (and probably other things too) fail when called from _PG_init() in
> > regular backends so that extension authors are made aware of this
> > hazard, or perhaps go the other way and change the order we do things
> > in parallel workers.
>
> Hmm. There's an argument to be made for the latter: we don't really
> want stuff failing in parallel workers if it works fine normally.
>
> On the other hand, it seems clear to me that we *don't* want extensions to
> be doing stuff like syscache lookups in _PG_init(), because that would
> prevent them from working as shared_preload_libraries entries.
>
> And on the third hand, intentionally breaking code that used to work
> isn't likely to win us many friends either. So I'm not sure that your
> first option is really tenable. Perhaps we could get away with doing
> it in HEAD and not back-patching ... but that does little for existing
> problems.

Ok, so I guess we should just make it work then. Here's throw-away
test patch to make "unaccent" blow up in this way, and a draft patch
to reorder things so that it works.

CREATE EXTENSION unaccent;
CREATE TABLE t AS SELECT 'hello world' AS v FROM generate_series(1, 1000000);
ANALYZE t;
EXPLAIN ANALYZE SELECT COUNT(unaccent(v)) FROM t;

--
Thomas Munro
http://www.enterprisedb.com

Attachment Content-Type Size
0001-Hack-to-make-unaccent-poke-syscache.patch application/octet-stream 914 bytes
0002-Defer-restoration-of-libraries-in-parallel-workers.patch application/octet-stream 2.6 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2018-08-30 00:24:16 BUG #15358: PostgreSQL fails to build on 10.14 when Perl is enabled.
Previous Message Michael Paquier 2018-08-29 20:54:36 Re: BUG #15346: Replica fails to start after the crash