pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ed Loehr <eloehr@austin.rr.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Vacuum Question
Date: Tue, 06 Jun 2000 17:25:04 -0400
Message-ID: <1002.960326704@sss.pgh.pa.us> (raw)
In-Reply-To: <393D40F2.BC3966D4@austin.rr.com>
References: <20000601091701.631.qmail@mail01.edsamail.com.ph>
	<13854.959924635@sss.pgh.pa.us>
	<3937C85E.88ADA7EC@austin.rr.com>
	<14982.959958663@sss.pgh.pa.us>
	<393C94A7.AC0F4642@austin.rr.com>
	<393C9639.639975A@austin.rr.com>
	<22661.960275884@sss.pgh.pa.us>
	<393D0804.EFA07399@austin.rr.com>
	<28630.960313999@sss.pgh.pa.us>
	<393D40F2.BC3966D4@austin.rr.com>

Ed Loehr <eloehr@austin.rr.com> writes:
> Tom Lane wrote:
>> I can't reproduce any problem with just a "vacuum" (with or without
>> analyze) and no following command.
>> 
>> I did, however, notice that very occasionally the inserting process
>> would spit out weird error messages like "Function '(int4)' does not
>> exist" and  null probin for procedure 481".  This seems
>> to be due to VACUUM (on system tables) causing syscache entries to be
>> flushed at unexpected times.  I've committed patches for the two cases
>> I observed, but there may be more lurking...

> Yes, I was getting a similar Function error message, though I never saw
> the init_fcache message.  And it appeared the backend would crash
> coincidentally with the function error message.  If the patch can be
> applied to 7.0 (beta3), and you don't mind posting it, I could test it
> here...

Hmm, I only saw error messages, no crashes --- but I suppose a crash is
possible, since the root of the problem here is a dangling pointer.

Patches for 7.0.2 are attached.  Not sure if they will apply perfectly
cleanly to beta3, but you should be able to make the right mods by hand
if patch doesn't cope...

			regards, tom lane

inline patch 1: src/backend/parser/parse_type.c, src/backend/utils/cache/fcache.c (+10/-5 lines) download inline-1.patch*** src/backend/parser/parse_type.c.orig Tue May 30 00:24:49 2000 --- src/backend/parser/parse_type.c Tue Jun 6 11:41:08 2000 *************** *** 48,54 **** return NULL; } typetuple = (Form_pg_type) GETSTRUCT(tup); ! return NameStr(typetuple->typname); } /* return a Type structure, given a type id */ --- 48,55 ---- return NULL; } typetuple = (Form_pg_type) GETSTRUCT(tup); ! /* pstrdup here because result may need to outlive the syscache entry */ ! return pstrdup(NameStr(typetuple->typname)); } /* return a Type structure, given a type id */ *************** *** 119,125 **** Form_pg_type typ; typ = (Form_pg_type) GETSTRUCT(t); ! return NameStr(typ->typname); } /* given a type, return its typetype ('c' for 'c'atalog types) */ --- 120,127 ---- Form_pg_type typ; typ = (Form_pg_type) GETSTRUCT(t); ! /* pstrdup here because result may need to outlive the syscache entry */ ! return pstrdup(NameStr(typ->typname)); } /* given a type, return its typetype ('c' for 'c'atalog types) */ *** src/backend/utils/cache/fcache.c~ Wed Apr 12 13:15:53 2000 --- src/backend/utils/cache/fcache.c Tue Jun 6 13:39:03 2000 *************** *** 14,19 **** --- 14,20 ---- */ #include "postgres.h" + #include "access/heapam.h" #include "catalog/pg_language.h" #include "catalog/pg_proc.h" #include "catalog/pg_type.h" *************** *** 89,97 **** if (!use_syscache) elog(ERROR, "what the ????, init the fcache without the catalogs?"); ! procedureTuple = SearchSysCacheTuple(PROCOID, ! ObjectIdGetDatum(foid), ! 0, 0, 0); if (!HeapTupleIsValid(procedureTuple)) elog(ERROR, "init_fcache: Cache lookup failed for procedure %u", --- 90,98 ---- if (!use_syscache) elog(ERROR, "what the ????, init the fcache without the catalogs?"); ! procedureTuple = SearchSysCacheTupleCopy(PROCOID, ! ObjectIdGetDatum(foid), ! 0, 0, 0); if (!HeapTupleIsValid(procedureTuple)) elog(ERROR, "init_fcache: Cache lookup failed for procedure %u", *************** *** 258,263 **** --- 259,266 ---- } else retval->func.fn_addr = (func_ptr) NULL; + + heap_freetuple(procedureTuple); return retval; }

view thread (33+ messages)  latest in thread

Message-ID: <1002.960326704@sss.pgh.pa.us>
Permalink:  ../1002.960326704@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1002.960326704@sss.pgh.pa.us

 ·  · 

reply

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-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, eloehr@austin.rr.com
  Subject: Re: Vacuum Question
  In-Reply-To: <1002.960326704@sss.pgh.pa.us>
  References: <20000601091701.631.qmail@mail01.edsamail.com.ph> <13854.959924635@sss.pgh.pa.us> <3937C85E.88ADA7EC@austin.rr.com> <14982.959958663@sss.pgh.pa.us> <393C94A7.AC0F4642@austin.rr.com> <393C9639.639975A@austin.rr.com> <22661.960275884@sss.pgh.pa.us> <393D0804.EFA07399@austin.rr.com> <28630.960313999@sss.pgh.pa.us> <393D40F2.BC3966D4@austin.rr.com> <1002.960326704@sss.pgh.pa.us>

* 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