Re: ERROR: unexpected chunk number 0 (expected 1) for toast value 76753264 in pg_toast_10920100 - Mailing list pgsql-general

From Tom Lane
Subject Re: ERROR: unexpected chunk number 0 (expected 1) for toast value 76753264 in pg_toast_10920100
Date
Msg-id 25544.1522962278@sss.pgh.pa.us
Whole thread Raw
In response to Re: ERROR: unexpected chunk number 0 (expected 1) for toast value 76753264 in pg_toast_10920100  (adsj@novozymes.com (Adam Sjøgren))
Responses Re: ERROR: unexpected chunk number 0 (expected 1) for toast value76753264 in pg_toast_10920100  (Pavan Deolasee <pavan.deolasee@gmail.com>)
List pgsql-general
adsj@novozymes.com (Adam =?utf-8?Q?Sj=C3=B8gren?=) writes:
>> [... still waiting for the result, I will return with what it said
>> when the server does ...]

> It did eventually finish, with the same result:

Huh.  So what we have here, apparently, is that regular MVCC snapshots
think there is exactly one copy of the 1698936148/0 row, but TOAST fetches
think there is more than one.  This is darn odd, not least because we
never do UPDATEs in toast tables, only inserts and deletes, so there
certainly shouldn't be update chains there.

It seems like you've got some corner case wherein SnapshotToast sees a row
that isn't visible according to MVCC --- probably a row left over from
some previous cycle of life.  That is, I'm imagining the OID counter
wrapped around and we've reused a toast OID, but for some reason there's
still a row in the table with that OID.  I'm not sure offhand how we could
get into such a state.  Alvaro, does this ring any bells (remembering that
this is 9.3)?

            regards, tom lane


pgsql-general by date:

Previous
From: Jerry Sievers
Date:
Subject: Re: PgUpgrade bumped my XIDs by ~50M?
Next
From: hmidi slim
Date:
Subject: decompose big queries