can you have any idea about toast missing chunk issu resolution

Started by M Tarkeshwar Raoalmost 11 years ago2 messages
#1M Tarkeshwar Rao
m.tarkeshwar.rao@ericsson.com

Hi all,

We are getting following error message on doing any action on the table like(Select or open from pgadmin).

Please suggest.

ERROR: missing chunk number 0 for toast value 54787 in pg_toast_2619
********** Error **********

ERROR: missing chunk number 0 for toast value 54787 in pg_toast_2619
SQL state: XX000

CREATE TABLE mm_activealarm
(
alarm_id integer NOT NULL,
source_address character varying(255) NOT NULL,
alarm_instance_id integer NOT NULL,
alarm_raise_time bigint,
alarm_update_time bigint,
alarm_cease_time bigint,
alarm_count integer,
alarm_severity integer NOT NULL,
source_type character varying(40) NOT NULL,
alarm_state integer NOT NULL,
event_type integer,
notification_id integer NOT NULL,
probable_cause integer NOT NULL,
specific_problem integer NOT NULL,
alarm_additional_text character varying(10240),
alarm_ack_time bigint,
alarm_ack_user character varying(100) NOT NULL,
alarm_ack_system character varying(100) NOT NULL,
alarm_proposed_repair_action character varying(10240) NOT NULL,
CONSTRAINT mm_activealarm_pk PRIMARY KEY (alarm_id, source_address)
USING INDEX TABLESPACE mgrdata
)
WITH (
OIDS=FALSE
)
TABLESPACE mgrdata;
ALTER TABLE ss_activealarm
OWNER TO ss_super;

Regards
Tarkeshwar

#2Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: M Tarkeshwar Rao (#1)
Re: can you have any idea about toast missing chunk issu resolution

On 1/15/15 6:22 AM, M Tarkeshwar Rao wrote:

We are getting following error message on doing any action on the table like(Select or open from pgadmin).

Error reports should go to pgsql-general. I'm moving the discussion there (and BCC'ing -hackers).

Please suggest.

ERROR: missing chunk number 0 for toast value 54787 in pg_toast_2619

********** Error **********

ERROR: missing chunk number 0 for toast value 54787 in pg_toast_2619

SQL state: XX000

That means that the database tried to detoast a value and it couldn't find it in the toast table. Likely causes:

- Someone manually modified the toast table. Hard to do, but not impossible.
- The toast index is corrupted. toast_fetch_datum() will always use a toast index so the only way to see if this is the issue is to try REINDEXing.
- The index is fine and the toast table is corrupted.
- The base table is corrupted. I think a corrupt index on the base table could also cause this, but I'm not sure.
- You've found some bug in either the toast or detoast code.

Note that when I say 'corrupted', that could also mean that the data is there and simply isn't being considered as visible per MVCC rules. Also, the actual condition throwing this error is

if (nextidx != numchunks)

where

numchunks = ((ressize - 1) / TOAST_MAX_CHUNK_SIZE) + 1;

and nextidx is incremented with every chunk that's read.

The easiest thing to try right now is a REINDEX and see if that fixes things. It would be best if you stopped the server and made a filesystem copy of the data directory before doing that (or at least pg_clog, pg_xlog and the relevant toast heap and index files).
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers