From: jimmy <mpokky@126.com>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re:Re: Re: Bug: ERROR: invalid cache ID: 42 CONTEXT: parallel worker
Date: Fri, 24 Aug 2018 14:04:24 +0800 (CST)
Message-ID: <54e0ae04.5659.1656a88a43b.Coremail.mpokky@126.com> (raw)
In-Reply-To: <CAEepm=30uOeesrmZWBj6zFh-E2hByJseyoM2ZtUS2r0E5G9zyA@mail.gmail.com>
References: <4898e5c4.6fed.16546f8f8cf.Coremail.mpokky@126.com>
<13291.1534512497@sss.pgh.pa.us>
<6294a60f.3289.1655f8e02f6.Coremail.mpokky@126.com>
<CAEepm=30uOeesrmZWBj6zFh-E2hByJseyoM2ZtUS2r0E5G9zyA@mail.gmail.com>
I create two normal postgresql tables, and import datas from two foreign tables.
Then I use four normal postgresql tables to query data, and it still throw these errors, after that I am afraid that it maybe is not connection with oracle fdw.
In these tables, one table has over 200 fields, and the other two tables, each table has over 800 fields.
When I use left join, Would that be the problem that caused this.
At 2018-08-22 12:47:30, "Thomas Munro" <thomas.munro@enterprisedb.com> wrote:
>On Wed, Aug 22, 2018 at 2:54 PM, jimmy <mpokky@126.com> wrote:
>> This is the debug log below. Is it useful. Thank you.
>
>That's not showing the path that reaches the error. If it's happening
>in a parallel worker, that'll probably be tricky to catch with a
>breakpoint. Are you able to recompile PostgreSQL? If you could do
>that after changing all cases of elog(ERROR, "invalid cache ID: %d",
>cacheId) to PANIC instead of ERROR, and then start it with ulimit -c
>unlimited, you might get a core file that you can load into a debugger
>to see how we reached it.
>
>It's a strange error. I don't think it can be coming from these
>places in inval.c:
>
> if (cacheid < 0 || cacheid >= SysCacheSize)
> elog(ERROR, "invalid cache ID: %d", cacheid);
>
>... because we can see that it's 42 (PROCNAMEARGSNSP, a valid cache
>ID), and SysCacheSize is a compile-time constant greater than 42. So
>it must be coming from one of the places in syscache.c that look like
>this:
>
> if (cacheId < 0 || cacheId >= SysCacheSize ||
> !PointerIsValid(SysCache[cacheId]))
> elog(ERROR, "invalid cache ID: %d", cacheId);
>
>Since InitCatalogCache() puts a non-NULL pointer into every index from
>0 to SysCacheSize - 1 without gaps (or it errors out if it fails while
>trying), it seems like either InitCatalogCache() didn't run, or
>SysCache[42] has later been overwritten with NULL? I wondered if
>there is some way for a parallel worker to reach shared invalidation
>message processing code before the InitCatalogCache() has run, but
>that doesn't seem to be an issue: SysCacheInvalidate() quietly
>tolerates that.
>
>I wonder how we could reach one of SearchSysCache(PROCNAMEARGSNSP,
>...), SysCacheGetAttr(PROCNAMEARGSNSP, ...),
>GetSysCacheHashValue(PROCNAMEARGSNSP, ...),
>SearchSysCacheList(PROCNAMEARGSNSP, ...) before InitCatalogCache() has
>finished? The answer probably involves oracle_fdw.
>
>Ahh, how about this line here:
>
>https://github.com/laurenz/oracle_fdw/blob/master/oracle_fdw.c#L6237
>
>catlist = SearchSysCacheList2(
>PROCNAMEARGSNSP,
>CStringGetDatum("geometry_recv"),
>PointerGetDatum(buildoidvector(argtypes, argcount)));
>
>I don't immediately see how that can be reached before
>InitCatalogCache() has run, though.
>
>--
>Thomas Munro
>http://www.enterprisedb.com
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: mpokky@126.com, thomas.munro@enterprisedb.com, tgl@sss.pgh.pa.us
Subject: Re: Bug: ERROR: invalid cache ID: 42 CONTEXT: parallel worker
In-Reply-To: <54e0ae04.5659.1656a88a43b.Coremail.mpokky@126.com>
References: <4898e5c4.6fed.16546f8f8cf.Coremail.mpokky@126.com> <13291.1534512497@sss.pgh.pa.us> <6294a60f.3289.1655f8e02f6.Coremail.mpokky@126.com> <CAEepm=30uOeesrmZWBj6zFh-E2hByJseyoM2ZtUS2r0E5G9zyA@mail.gmail.com> <54e0ae04.5659.1656a88a43b.Coremail.mpokky@126.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