Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id A6294B5DBE0 for ; Fri, 23 Sep 2011 14:10:35 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 80938-05 for ; Fri, 23 Sep 2011 17:10:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11]) by mail.postgresql.org (Postfix) with ESMTP id 52A51B5DBD1 for ; Fri, 23 Sep 2011 14:10:28 -0300 (ADT) Received: by mail.netbsd.org (Postfix, from userid 1270) id 2962F14A1BC; Fri, 23 Sep 2011 17:10:26 +0000 (UTC) To: tgl@sss.pgh.pa.us Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6218: TRAP: FailedAssertion( "!(owner->nsnapshots == 0)", File: "resowner.c", Line: 365) In-Reply-To: Your message of "Wed, 21 Sep 2011 11:58:00 -0400" <24084.1316620680@sss.pgh.pa.us> References: <24084.1316620680@sss.pgh.pa.us> X-Mailer: Cue version 0.8 (100217-1432/takashi) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Message-Id: <20110923171026.2962F14A1BC@mail.netbsd.org> Date: Fri, 23 Sep 2011 17:10:26 +0000 (UTC) From: yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/160 X-Sequence-Number: 31177 hi, > "YAMAMOTO Takashi" writes: >> 9.2devel (2562dcea811eb642e1c5442e1ede9fe268278157) > >> ERROR: could not serialize access due to concurrent update >> STATEMENT: UPDATE file SET atime = current_timestamp WHERE fileid = $1 >> TRAP: FailedAssertion("!(owner->nsnapshots == 0)", File: "resowner.c", Line: >> 365) >> LOG: server process (PID 16832) was terminated by signal 6: Abort trap > > There isn't terribly much we can do with this report unless you can > provide a complete test case to reproduce it. > > regards, tom lane after some investigation, i think it is triggered by protocol-level prepare of ROLLBACK in an aborted transaction. does the following patch make sense? YAMAMOTO Takashi diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.c index 9cccc87..d1da7df 100644 --- a/src/backend/utils/cache/plancache.c +++ b/src/backend/utils/cache/plancache.c @@ -520,6 +520,7 @@ RevalidateCachedQuery(CachedPlanSource *plansource) * don't have invalidatable plans, so we'd not get here for such a * command. */ + Assert(analyze_requires_snapshot(plansource->raw_parse_tree)); snapshot_set = false; if (!ActiveSnapshotSet()) { @@ -757,13 +758,11 @@ BuildCachedPlan(CachedPlanSource *plansource, List *qlist, /* * If a snapshot is already set (the normal case), we can just use - * that for parsing/planning. But if it isn't, install one. Note: no - * point in checking whether parse analysis requires a snapshot; - * utility commands don't have invalidatable plans, so we'd not get - * here for such a command. + * that for parsing/planning. But if it isn't, install one. */ snapshot_set = false; - if (!ActiveSnapshotSet()) + if (!ActiveSnapshotSet() && + analyze_requires_snapshot(plansource->raw_parse_tree)) { PushActiveSnapshot(GetTransactionSnapshot()); snapshot_set = true;