From: adsj@novozymes.com
To: pgsql-general@postgresql.org
Subject: Re: ERROR: unexpected chunk number 0 (expected 1) for toast value 76753264 in pg_toast_10920100
Date: Tue, 10 Apr 2018 13:52:20 +0200
Message-ID: <87efjnp9cb.fsf@tullinup.koldfront.dk> (raw)
References: <7pefuv53dl.fsf@novozymes.com>
<871siqcdjh.fsf@tullinup.koldfront.dk>
<SC1P15201MB2015B0AEF742D4D77E27D60EBCEA0@SC1P15201MB2015.LAMP152.PROD.OUTLOOK.COM>
<87efmpllwg.fsf@tullinup.koldfront.dk>
<20180117025021.GA39977@paquier.xyz>
<874lnlc6ja.fsf@tullinup.koldfront.dk>
<7632.1516209379@sss.pgh.pa.us>
<87k1tlel41.fsf@tullinup.koldfront.dk>
<17892.1522942621@sss.pgh.pa.us>
<877eplej3o.fsf@tullinup.koldfront.dk>
<87y3i1flgn.fsf@tullinup.koldfront.dk>
<25544.1522962278@sss.pgh.pa.us>
<CABOikdPe3Zq8VXVH+QWb2Kj6JemFyuz4y91SwmfKdNL=BsHo9w@mail.gmail.com>
<CABOikdPJUv5EyxRZnJY2oA7EKi=bZdoryXNmUGK3dFAQ08tZdw@mail.gmail.com>
Pavan writes:
>> FWIW one of our support customers reported a very similar TOAST table
>> corruption issue last week which nearly caused an outage. After a lot of
>> analysis, I think I've now fully understood the reasons behind the
>> corruption, the underlying bug(s) and possible remedy. I am currently
>> working on writing a reproducible test case to demonstrate the problem and
>> writing the fix. More details on that soon.
>
> I've posted a reproducer and a proposed fix to -hackers [1]
>
> In the particular case that I investigated, a database crash/recovery was
> involved. But I think we should be able to create a scenario where OID
> wrap-around or a standby promotion triggers the problem. I don't know if
> any of that was involved in the cases reported on this thread, but I've a
> strong suspicion that the underlying bug is probably the same.
In our case there was no crash+recovery, but we do have a high write
load (and the problem occurring quite seldom), so it sounds like it
fits.
> [1] https://www.postgresql.org/message-id/CABOikdOgWT2hHkYG3Wwo2cyZJq2zfs1FH0FgX-%3Dh4OLosXHf9w%40mail.g...
Impressive investigation!
Just a couple of data points: your script to reproduce the problem does
so for all three versions of PostgreSQL we have in use: 9.3.22, 9.6.8
and 10.3.
And I specifically tested on our production machine which exhibits the
problem, running 9.3.22, and your script reproduced the problem there as
well.
I.e. ending with:
ERROR: unexpected chunk number 0 (expected 1) for toast value 16396 in pg_toast_16384
REINDEX
ERROR: unexpected chunk number 0 (expected 1) for toast value 16396 in pg_toast_16384
VACUUM
ERROR: unexpected chunk number 0 (expected 1) for toast value 16396 in pg_toast_16384
Best regards,
Adam
--
"No more than that, but very powerful all the Adam Sjøgren
same; simple things are good." adsj@novozymes.com
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-general@postgresql.org
Cc: adsj@novozymes.com
Subject: Re: ERROR: unexpected chunk number 0 (expected 1) for toast value 76753264 in pg_toast_10920100
In-Reply-To: <87efjnp9cb.fsf@tullinup.koldfront.dk>
References: <7pefuv53dl.fsf@novozymes.com> <871siqcdjh.fsf@tullinup.koldfront.dk> <SC1P15201MB2015B0AEF742D4D77E27D60EBCEA0@SC1P15201MB2015.LAMP152.PROD.OUTLOOK.COM> <87efmpllwg.fsf@tullinup.koldfront.dk> <20180117025021.GA39977@paquier.xyz> <874lnlc6ja.fsf@tullinup.koldfront.dk> <7632.1516209379@sss.pgh.pa.us> <87k1tlel41.fsf@tullinup.koldfront.dk> <17892.1522942621@sss.pgh.pa.us> <877eplej3o.fsf@tullinup.koldfront.dk> <87y3i1flgn.fsf@tullinup.koldfront.dk> <25544.1522962278@sss.pgh.pa.us> <CABOikdPe3Zq8VXVH+QWb2Kj6JemFyuz4y91SwmfKdNL=BsHo9w@mail.gmail.com> <CABOikdPJUv5EyxRZnJY2oA7EKi=bZdoryXNmUGK3dFAQ08tZdw@mail.gmail.com> <87efjnp9cb.fsf@tullinup.koldfront.dk>
* 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