pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pius Chan <pchan@contigo.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Cc: Frank Moi <fmoi@contigo.com>
Cc: Ken Yu <kyu@contigo.com>
Cc: Vincent Lasmarias <vlasmarias@contigo.com>
Cc: Vladimir Kosilov <vkosilov@contigo.com>
Subject: Re: BUG #7819: missing chunk number 0 for toast value 1235919 in pg_toast_35328
Date: Fri, 01 Feb 2013 15:08:54 -0500
Message-ID: <21192.1359749334@sss.pgh.pa.us> (raw)
In-Reply-To: <C62EC84B2D3CF847899CCF4B589CCF70B20AA094@BBMBX.backbone.local>
References: <E1TxRlp-0007zA-Mw@wrigleys.postgresql.org>
	<4542.1358819585@sss.pgh.pa.us>
	<C62EC84B2D3CF847899CCF4B589CCF70B20AA065@BBMBX.backbone.local>
	<5120.1358914486@sss.pgh.pa.us>
	<C62EC84B2D3CF847899CCF4B589CCF70B20AA08F@BBMBX.backbone.local>
	<20515.1359747686@sss.pgh.pa.us>
	<C62EC84B2D3CF847899CCF4B589CCF70B20AA094@BBMBX.backbone.local>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Pius Chan <pchan@contigo.com> writes:
> Thanks for your prompt response. Yeah, I should have provided you with my testing scripts. BTW, during numerous tests, I felt that if there is no long holding transaction (the one used for middle-tier service master/slave failover), the database server is much quicker to recover the space left by dead-row and it is also hard to make the TOAST area grow. Therefore, it is hard for me to reproduce the ERROR if there is no long-holding open transaction. Do you have any insight to it?

I think the proximate cause is probably this case mentioned in
GetOldestXmin's comments:

 * if allDbs is FALSE and there are no transactions running in the current
 * database, GetOldestXmin() returns latestCompletedXid. If a transaction
 * begins after that, its xmin will include in-progress transactions in other
 * databases that started earlier, so another call will return a lower value.

So the trouble case is where autovacuum on the toast table starts at an
instant where nothing's running in the "test" database, but there are
pre-existing transaction(s) in the other database.  Then later CLUSTER
starts at an instant where transactions are running in "test" and their
xmins include the pre-existing transactions.

So you need long-running transactions in another DB than the one where
the vacuuming/clustering action is happening, as well as some unlucky
timing.  Assuming my theory is the correct one, of course.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (10+ messages)

Message-ID: <21192.1359749334@sss.pgh.pa.us>
Permalink:  ../21192.1359749334@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21192.1359749334@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, pchan@contigo.com, fmoi@contigo.com, kyu@contigo.com, vlasmarias@contigo.com, vkosilov@contigo.com
  Subject: Re: BUG #7819: missing chunk number 0 for toast value 1235919 in pg_toast_35328
  In-Reply-To: <21192.1359749334@sss.pgh.pa.us>
  References: <E1TxRlp-0007zA-Mw@wrigleys.postgresql.org> <4542.1358819585@sss.pgh.pa.us> <C62EC84B2D3CF847899CCF4B589CCF70B20AA065@BBMBX.backbone.local> <5120.1358914486@sss.pgh.pa.us> <C62EC84B2D3CF847899CCF4B589CCF70B20AA08F@BBMBX.backbone.local> <20515.1359747686@sss.pgh.pa.us> <C62EC84B2D3CF847899CCF4B589CCF70B20AA094@BBMBX.backbone.local> <21192.1359749334@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