From: Tom Lane <tgl@sss.pgh.pa.us>
To: ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-hackers@postgresql.org
Subject: Re: CSStorm occurred again by postgreSQL8.2
Date: Sun, 03 Sep 2006 12:08:58 -0400
Message-ID: <13251.1157299738@sss.pgh.pa.us> (raw)
In-Reply-To: <20060828181312.5638.ITAGAKI.TAKAHIRO@oss.ntt.co.jp>
References: <20060808110913.50FA.ITAGAKI.TAKAHIRO@oss.ntt.co.jp>
<200608260346.k7Q3k2g06954@momjian.us>
<20060828181312.5638.ITAGAKI.TAKAHIRO@oss.ntt.co.jp>
ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp> writes:
> I added a subxid array to Snapshot and running subxids are gathered from
> PGPROC->subxids cache. There are two overflowed case; any of PGPROC->subxids
> are overflowed or the number of total subxids exceeds pre-allocated buffers.
> If overflowed, we cannot avoid to call SubTransGetTopmostTransaction.
Applied after some editorialization (you really need to pay more
attention to keeping comments in sync with code ;-))
I cannot measure any consistent speed difference in plain pgbench
scenarios with and without the patch, so at least as a rough
approximation the extra cycles in GetSnapshotData aren't hurting.
And I confirm that the test case you posted before no longer exhibits
a context-swap storm.
This change makes it even more obvious than before that we really want
to stay out of the subxids-overflowed regime. I don't especially want
to make those arrays even bigger, but I wonder if there isn't more we
can do to use them efficiently. In particular, it seems like in the
case where RecordSubTransactionCommit detects that the subxact has not
stored its XID anywhere, we could immediately remove the XID from
the PGPROC array, just as if it had aborted. This would avoid chewing
subxid slots for cases such as exception blocks in plpgsql that are
not modifying the database, but just catching computational errors.
Comments?
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, itagaki.takahiro@oss.ntt.co.jp, bruce@momjian.us, alvherre@alvh.no-ip.org
Subject: Re: CSStorm occurred again by postgreSQL8.2
In-Reply-To: <13251.1157299738@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