pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: yamt <yamt@mwd.biglobe.ne.jp>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [BUGS] BUG #6218: TRAP: FailedAssertion( "!(owner->nsnapshots == 0)", File: "resowner.c", Line: 365)
Date: Mon, 26 Sep 2011 21:33:03 -0300
Message-ID: <1317083058-sup-9596@alvh.no-ip.org> (raw)
In-Reply-To: <6382.1317081585@sss.pgh.pa.us>
References: <5291.1316980809@sss.pgh.pa.us>
	<20110926100653.4D3BC14A143@mail.netbsd.org>
	<8244.1317054397@sss.pgh.pa.us>
	<1317070986-sup-4844@alvh.no-ip.org>
	<2126.1317073572@sss.pgh.pa.us>
	<6382.1317081585@sss.pgh.pa.us>


Excerpts from Tom Lane's message of lun sep 26 20:59:45 -0300 2011:

> Well, I soon ran into the issue that delaying the snapshot release makes
> TopTransactionResourceOwner spit up.  After some reflection I decided
> that the real problem is a circular dependency: snapshot management must
> be considered lower-level than ResourceOwners because ResourceOwners
> tell snapshot management what to do, but here we have
> GetTransactionSnapshot trying to use TopTransactionResourceOwner to
> manage its internal reference to the transaction snapshot.

Great.  I noticed the circularity but didn't reflect that it was bogus
in itself.

> Accordingly, the attached proposed patch gets rid of the circularity
> by removing snapmgr.c's dependency on TopTransactionResourceOwner,
> in favor of having it track the refcount "manually".  This was messier
> than I'd hoped because the bogus design had propagated into the SSI
> manager meanwhile, but removing the TopTransactionResourceOwner
> dependency from that too seems like a good idea.

To be honest, I panicked for a second when I saw the new
SnapshotResetXmin call, before I realized that it wasn't necessary
before.  The serializable case makes more sense the patched way, I
think.

> This passes the regular and isolation regression tests, and it's also
> okay with Yamamoto-san's prepared-ROLLBACK test case even without the
> band-aid fix in plancache.c.  I can't immediately think of any other
> test cases to throw at it.

I added tests for all the problematic cases discovered after snapmgr was
introduced, so at least most known weird spots are covered.

Thanks

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



view thread (11+ messages)  latest in thread

Message-ID: <1317083058-sup-9596@alvh.no-ip.org>
Permalink:  ../1317083058-sup-9596@alvh.no-ip.org/
Also on:    postgresql.org/message-id/1317083058-sup-9596@alvh.no-ip.org

 · 

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-bugs@postgresql.org
  Cc: alvherre@commandprompt.com, tgl@sss.pgh.pa.us, yamt@mwd.biglobe.ne.jp, pgsql-hackers@postgresql.org
  Subject: Re: [BUGS] BUG #6218: TRAP: FailedAssertion( "!(owner->nsnapshots == 0)", File: "resowner.c", Line: 365)
  In-Reply-To: <1317083058-sup-9596@alvh.no-ip.org>
  References: <5291.1316980809@sss.pgh.pa.us> <20110926100653.4D3BC14A143@mail.netbsd.org> <8244.1317054397@sss.pgh.pa.us> <1317070986-sup-4844@alvh.no-ip.org> <2126.1317073572@sss.pgh.pa.us> <6382.1317081585@sss.pgh.pa.us> <1317083058-sup-9596@alvh.no-ip.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