Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U1Muz-00014s-PM for pgsql-bugs@arkaria.postgresql.org; Fri, 01 Feb 2013 20:09:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U1Muz-0000cE-64 for pgsql-bugs@arkaria.postgresql.org; Fri, 01 Feb 2013 20:09:01 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U1Mux-0000bG-S9 for pgsql-bugs@postgresql.org; Fri, 01 Feb 2013 20:09:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U1Muu-0001Qu-Il for pgsql-bugs@postgresql.org; Fri, 01 Feb 2013 20:08:59 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r11K8sdi021193; Fri, 1 Feb 2013 15:08:54 -0500 (EST) From: Tom Lane To: Pius Chan cc: "pgsql-bugs@postgresql.org" , Frank Moi , Ken Yu , Vincent Lasmarias , Vladimir Kosilov Subject: Re: BUG #7819: missing chunk number 0 for toast value 1235919 in pg_toast_35328 In-reply-to: References: , <4542.1358819585@sss.pgh.pa.us> , <5120.1358914486@sss.pgh.pa.us> , <20515.1359747686@sss.pgh.pa.us> Comments: In-reply-to Pius Chan message dated "Fri, 01 Feb 2013 11:43:13 -0800" Date: Fri, 01 Feb 2013 15:08:54 -0500 Message-ID: <21192.1359749334@sss.pgh.pa.us> X-Pg-Spam-Score: -2.2 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Pius Chan 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