Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dn104-00070R-TS for pgsql-general@arkaria.postgresql.org; Wed, 30 Aug 2017 11:17:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dn104-0000b0-Dz for pgsql-general@arkaria.postgresql.org; Wed, 30 Aug 2017 11:17:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dn103-0000ao-R9 for pgsql-general@postgresql.org; Wed, 30 Aug 2017 11:17:35 +0000 Received: from feynman.df7cb.de ([195.49.152.168]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dn100-0004Zk-9v for pgsql-general@postgresql.org; Wed, 30 Aug 2017 11:17:35 +0000 Received: from msg.df7cb.de (unknown [IPv6:2003:5b:203b:100:7627:eaff:fe52:8e03]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by feynman.df7cb.de (Postfix) with ESMTPSA id 3xj2zG66Qhz3F15; Wed, 30 Aug 2017 13:17:30 +0200 (CEST) Date: Wed, 30 Aug 2017 13:17:30 +0200 From: Christoph Berg To: Harry Ambrose Cc: Scott Marlowe , adsj@novozymes.com, "pgsql-general@postgresql.org" Subject: Re: ERROR: unexpected chunk number 0 (expected 1) for toast value 76753264 in pg_toast_10920100 Message-ID: <20170830111730.ma2wyxwqrvssbdbq@msg.df7cb.de> Mail-Followup-To: Christoph Berg , Harry Ambrose , Scott Marlowe , adsj@novozymes.com, "pgsql-general@postgresql.org" References: <20170611033840.hruqadsk47qcdrqb@alvherre.pgsql> <7pfuf5ogho.fsf@novozymes.com> <7py3sll8rf.fsf_-_@novozymes.com> <7pvalxvsco.fsf@novozymes.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org Re: Harry Ambrose 2017-08-25 > Hi All, > > Sorry to open this can of worms again. However, we are still struggling > with this issue across quite a large amount of our estate. Hi, we've just seen exactly this error on a customer database running 9.5.3 (postgresql95.x86_64 9.5.3-2PGDG.rhel6). Luckily just one tuple was affected. Symptoms were: # select text from k... where id = 719764749; ERROR: unexpected chunk number 0 (expected 1) for toast value 3347468184 in pg_toast_922511637 The toast table itself was perfectly ok, with a single chunk: # select * from pg_toast.pg_toast_922511637 where chunk_id = 3347468184; chunk_id | 3347468184 chunk_seq | 0 chunk_data | ...valid text string... (with bytea_output = 'escape') Updating or deleting the field/row didn't work: # update k... set text = '...same text as above...' where id = 719764749; ERROR: XX000: tuple concurrently updated ORT: simple_heap_delete, heapam.c:3171 # delete from k... where id = 719764749; ERROR: XX000: tuple concurrently updated ORT: simple_heap_delete, heapam.c:3171 The problem persisted over the last two weeks (eventually noticed by pg_dump starting to fail between August 15th and 18th). The server was started on July 26th. Besides the ERRORing statements above, I didn't actively resolve it, suddenly SELECTing the original row just worked again. According to pg_stat_user_tables, autovacuum didn't hit in. I can't say if there were backends open for two weeks. At the time it resolved itself, the oldest backend was from August 27th. If xmin/xmax/multixact... data from this server is interesting, I can extract it on request. Christoph -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general