From: Tom Lane <tgl@sss.pgh.pa.us>
To: Maxim Boguk <maxim.boguk@gmail.com>
Cc: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #6393: cluster sometime fail under heavy concurrent write load
Date: Thu, 12 Jan 2012 13:19:14 -0500
Message-ID: <24904.1326392354@sss.pgh.pa.us> (raw)
In-Reply-To: <23799.1326389068@sss.pgh.pa.us>
References: <E1RknUp-0000cl-ME@wrigleys.postgresql.org>
<1326295419-sup-3436@alvh.no-ip.org>
<CAK-MWwTSE9REMB0XH6RrjL_SzSVfGDiV0y=AOm0EqoXs3zR+_g@mail.gmail.com>
<23799.1326389068@sss.pgh.pa.us>
I wrote:
> Yes, this is a consequence of commit
> 44b6d53b467bfe848c34c7a8a174779bb2f43c39, which tried to preserve toast
> OIDs when doing a table rewrite. The problem is that CLUSTER needs to
> copy both the old and new versions of an updated row, since the old one
> is only "recently dead", and both of those versions are pointing at the
> same TOAST item because the update didn't affect the toasted column.
> So when we save those versions into the new table separately, we try to
> write the same TOAST item twice.
BTW, it strikes me that the preceding implementation had its own bug in
this area: in the same situation of having to copy multiple versions of
a row, it would create independent copies of the referenced TOAST value.
Not only is this space-wasteful, but the copies attached to the
already-dead row versions would never be reclaimed, at least not short
of another CLUSTER, because they would be inserted into the toast table
as live not deleted rows.
So preserving toast item OIDs and relying on them for duplicate
detection actually will improve matters in a way unrelated to the
original purpose of commit 44b6d53b467bfe848c34c7a8a174779bb2f43c39.
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 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: tgl@sss.pgh.pa.us, maxim.boguk@gmail.com, alvherre@commandprompt.com
Subject: Re: BUG #6393: cluster sometime fail under heavy concurrent write load
In-Reply-To: <24904.1326392354@sss.pgh.pa.us>
References: <E1RknUp-0000cl-ME@wrigleys.postgresql.org> <1326295419-sup-3436@alvh.no-ip.org> <CAK-MWwTSE9REMB0XH6RrjL_SzSVfGDiV0y=AOm0EqoXs3zR+_g@mail.gmail.com> <23799.1326389068@sss.pgh.pa.us> <24904.1326392354@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