From: yamt@mwd.biglobe.ne.jp
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)
Date: Fri, 23 Sep 2011 17:10:26 +0000 (UTC)
Message-ID: <20110923171026.2962F14A1BC@mail.netbsd.org> (raw)
In-Reply-To: <24084.1316620680@sss.pgh.pa.us>
References: <24084.1316620680@sss.pgh.pa.us>
hi,
> "YAMAMOTO Takashi" <yamt@mwd.biglobe.ne.jp> 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
inline patch 1: src/backend/utils/cache/plancache.c (+4/-5 lines) download inline-1.patchdiff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.cindex 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;
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: yamt@mwd.biglobe.ne.jp, tgl@sss.pgh.pa.us
Subject: Re: BUG #6218: TRAP: FailedAssertion( "!(owner->nsnapshots == 0)", File: "resowner.c", Line: 365)
In-Reply-To: <20110923171026.2962F14A1BC@mail.netbsd.org>
References: <24084.1316620680@sss.pgh.pa.us> <20110923171026.2962F14A1BC@mail.netbsd.org>
* 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