BUG #14444: ERROR: unexpected chunk number

From: mahmoudhakh(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14444: ERROR: unexpected chunk number
Date: 2016-12-01 16:55:05
Message-ID: 20161201165505.4360.28203@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14444
Logged by: Mahmoud Hakeem-Habeeb
Email address: mahmoudhakh(at)gmail(dot)com
PostgreSQL version: 9.4.4
Operating system: Centos 6.6
Description:

I have been getting the error XX000 ERROR: unexpected chunk number 1486
(expected 2) for toast value 108447 in pg_toast_107398 on postgresql
9.4.X.
I never got this error on 9.2.X.
The error is return after a large transaction and we run a vacuum.
127.0.0.1 2016-11-29 17:19:27.619 00000 LOG: execute <unnamed>: VACUUM
(FULL, ANALYZE) table_2_9
127.0.0.1 2016-11-29 17:19:33.258 XX000 ERROR: unexpected chunk number 1486
(expected 2) for toast value 108447 in pg_toast_107398
127.0.0.1 2016-11-29 17:19:33.258 XX000 STATEMENT: VACUUM (FULL, ANALYZE)
table_2_9

How i reproduced it.

CREATE TABLE messages_template (
familyid integer NOT NULL,
uniqueid character varying NOT NULL,
lasttime bigint NOT NULL,
addid bigint NOT NULL,
delid bigint NOT NULL,
modid bigint NOT NULL,
smash character varying NOT NULL,
nametoken character varying NOT NULL,
resultid character varying NOT NULL,
exchthreadid character varying,
fromchar character varying NOT NULL,
fromname character varying,
tochar character varying NOT NULL,
date bigint NOT NULL,
size bigint NOT NULL,
title character varying NOT NULL,
hasatt boolean NOT NULL,
read boolean NOT NULL,
importance smallint,
mark smallint,
status smallint,
sensitivity smallint,
categories character varying,
recordings character varying,
stid character varying
);

create table table_2_9 (mid bigserial primary key) inherits
(messages_template) TABLESPACE table_data_3_ts_9

-- 2M rows of the below
insert into table_2_9 ( date, mark, title, importance, resultid, familyid,
uniqueid, hasatt, addid, delid, modid, smash, categories, read, tochar,
exchthreadid, fromname, nametoken, lasttime, size, stid, recordings,
sensitivity, fromchar, status ) values ( $1, $2, $3, $4, $5, $6, $7, $8, $9,
$10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24,
$25 );

parameters: $1 = '1000038', $2 = '1000039', $3 = '1000039', $4 = '1000039'
update table_2_9 set delid = $1 where ((addid < $2 and modid < $3 and delid
< $4) and NOT (delid>-1 and delid>=addid and delid>=modid));

VACUUM (FULL, ANALYZE) table_2_9

-- 50K times
update table_2_9 set date = $1 , mark = $2 , title = $3 , importance =
$4 , resultid = $5 , familyid = $6 , uniqueid = $7 , hasatt = $8 ,
addid = $9 , delid = $10 , modid = $11 , smash = $12 , categories = $13
, read = $14 , tochar = $15 , exchthreadid = $16 , fromname = $17 ,
nametoken = $18 , lasttime = $19 , size = $20 , stid = $21 , recordings
= $22 , sensitivity = $23 , fromchar = $24 , status = $25 where mid =
$26

update table_2_9 set delid = $1 where ((addid < $2 and modid < $3 and delid
< $4) and NOT (delid>-1 and delid>=addid and delid>=modid))
parameters: $1 = '1000040', $2 = '1000041', $3 = '1000041', $4 = '1000041'

VACUUM (FULL, ANALYZE) table_2_9

--out put in the log below
127.0.0.1 2016-11-29 17:19:27.619 00000 LOG: execute <unnamed>: VACUUM
(FULL, ANALYZE) table_2_9
127.0.0.1 2016-11-29 17:19:33.258 XX000 ERROR: unexpected chunk number 1486
(expected 2) for toast value 108447 in pg_toast_107398
127.0.0.1 2016-11-29 17:19:33.258 XX000 STATEMENT: VACUUM (FULL, ANALYZE)
table_2_9

The Error was on the second vacuum

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2016-12-01 22:03:08 Re: BUG #14444: ERROR: unexpected chunk number
Previous Message Peter Eisentraut 2016-12-01 13:56:50 Re: BUG #14442: serial maxvalue incorrect