Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dIbt4-0006vO-TQ for pgsql-general@arkaria.postgresql.org; Wed, 07 Jun 2017 14:24:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dIbt3-0005YF-SH for pgsql-general@arkaria.postgresql.org; Wed, 07 Jun 2017 14:24:41 +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 1dIbqf-0001IS-J9 for pgsql-general@postgresql.org; Wed, 07 Jun 2017 14:22:13 +0000 Received: from host3.dynacom.ondsl.gr ([62.103.35.211] helo=smadev.internal.net) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dIbqc-0005Kr-Cr for pgsql-general@postgresql.org; Wed, 07 Jun 2017 14:22:13 +0000 Received: from smadev.internal.net (smadev [10.9.200.131]) by smadev.internal.net (8.15.2/8.15.2) with ESMTP id v57EM5hP012576 for ; Wed, 7 Jun 2017 17:22:05 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) Subject: Re: ERROR: unexpected chunk number 0 (expected 1) for toast value 76753264 in pg_toast_10920100 To: pgsql-general@postgresql.org References: <7pefuv53dl.fsf@novozymes.com> From: Achilleas Mantzios Message-ID: Date: Wed, 7 Jun 2017 17:22:05 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <7pefuv53dl.fsf@novozymes.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Pg-Spam-Score: -1.9 (-) 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 On 07/06/2017 16:33, ADSJ (Adam Sjøgren) wrote: > Our database has started reporting errors like this: > > 2017-05-31 13:48:10 CEST ERROR: unexpected chunk number 0 (expected 1) for toast value 14242189 in pg_toast_10919630 > ... > 2017-06-01 11:06:56 CEST ERROR: unexpected chunk number 0 (expected 1) for toast value 19573520 in pg_toast_10919630 > > (157 times, for different toast values, same pg_toast_nnn). pg_toast_10919630 > corresponds to a table with around 168 million rows. > > These went away, but the next day we got similar errors from another > table: > > 2017-06-02 05:59:50 CEST ERROR: unexpected chunk number 0 (expected 1) for toast value 47060150 in pg_toast_10920100 > ... > 2017-06-02 06:14:54 CEST ERROR: unexpected chunk number 0 (expected 1) for toast value 47226455 in pg_toast_10920100 > > (Only 4 this time) pg_toast_10920100 corresponds to a table with holds > around 320 million rows (these are our two large tables). > > The next day we got 6 such errors and the day after 10 such errors. On > June 5th we got 94, yesterday we got 111, of which one looked a little > different: > > 2017-06-06 17:32:21 CEST ERROR: unexpected chunk size 1996 (expected 1585) in final chunk 0 for toast value 114925100 in pg_toast_10920100 > > and today the logs have 65 lines, ending with these: > > 2017-06-07 14:49:53 CEST ERROR: unexpected chunk number 0 (expected 1) for toast value 131114834 in pg_toast_10920100 > 2017-06-07 14:53:41 CEST ERROR: unexpected chunk number 0 (expected 1) for toast value 131149566 in pg_toast_10920100 First try to find which tables those toast relations refer to : select 10919630::regclass , 10920100::regclass ; Are those critical tables? Can you restore them somehow? Also you may consider REINDEX TABLE pg_toast.pg_toast_10920100; REINDEX TABLE pg_toast.pg_toast_10919630; REINDEX TABLE ; REINDEX TABLE ; also VACUUM the above tables. You might want to write a function which iterates over the damaged table's rows in order to identify the damaged row(s). And then do some good update to create a new version. > The database is 10 TB on disk (SSDs) and runs on a 48 core server with 3 > TB RAM on Ubuntu 14.04 (Linux 3.18.13). > > We are updating rows in the database a lot/continuously. > > There are no apparent indications of hardware errors (like ECC) in > dmesg, nor any error messages logged by the LSI MegaRAID controller, as > far as I can tell. > > We are running PostgreSQL 9.3.14 currently. > > The only thing I could see in the release notes since 9.3.14 that might > be related is this: > > "* Avoid very-low-probability data corruption due to testing tuple > visibility without holding buffer lock (Thomas Munro, Peter Geoghegan, > Tom Lane)" > > Although reading more about it, it doesn't sound like it would exhibit > the symptoms we see? > > We have recently increased the load (to around twice the number of > cores), though, which made me think we could be triggering corner cases > we haven't hit before. > > We will be upgrading to PostgreSQL 9.3.17 during the weekend, but I'd like to hear > if anyone has seen something like this, or have some ideas of how to > investigate/what the cause might be. > > > Best regards, > > Adam > -- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general