pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Karsten Hilbert <Karsten.Hilbert@gmx.net>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: unexpected chunk number 2 (expected 0) for toast value ... in pg_toast_18536
Date: Sun, 15 Mar 2020 19:23:49 +0100
Message-ID: <20200315182349.GL467@hermes.hilbert.loc> (raw)

Dear community,

we are seeing the below error on PG 9.6.16 on Debian:

(different issue from the psycopg2 one recently posted by me)

> /home/marc# pg_dump -p 5432 --username=gm-dbo --dbname=gnumed_v22 --compress=0 --no-sync --format=custom --file=/dev/null
> pg_dump: Ausgabe des Inhalts der Tabelle »doc_obj« fehlgeschlagen: PQgetResult() fehlgeschlagen.
> pg_dump: Fehlermeldung vom Server: ERROR:  unexpected chunk number 2 (expected 0) for toast value 99027 in pg_toast_18536
> pg_dump: Die Anweisung war: COPY blobs.doc_obj (pk, fk_doc, seq_idx, comment, fk_intended_reviewer, data, filename) TO stdout;

	(to note: column "data" is of type BYTEA)

We have been able to identify the row (there may be more)
in blobs.doc_obj which leads to the above error.

	blobs.doc_obj.pk -> 82224

We have ruled out (?) below-PG hardware problems by a
successful run of:

	cp -rv —preserve=all /var/lib/postgresql/9.6  /tmp/

We then tried

	gnumed_v22=# REINDEX TABLE pg_toast.pg_toast_18536;
	REINDEX
	gnumed_v22=# REINDEX TABLE blobs.doc_obj ;
	REINDEX
	gnumed_v22=# VACUUM ANALYZE pg_toast.pg_toast_18536;
	VACUUM
	gnumed_v22=# VACUUM FULL pg_toast.pg_toast_18536;
	VACUUM
	gnumed_v22=# VACUUM ANALYZE blobs.doc_obj ;
	VACUUM
	gnumed_v22=# VACUUM FULL blobs.doc_obj ;
	ERROR:  unexpected chunk number 2 (expected 0) for toast value 99027 in pg_toast_18536

We then tried to DELETE the offending row

	delete from blobs.doc_obj where pk = 82224;

but that, again, shows the "unexpected chunk" problem.

Now, what else can we try to address the problem short of
doing the

	pg_dump --exclude-table-data=blobs.doc_obj

	judicious use of COPY-FROM-with-subselect from blobs.doc_obj

	restore

dance ?

Many thanks,
Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B





view thread (16+ messages)  latest in thread

Message-ID: <20200315182349.GL467@hermes.hilbert.loc>
Permalink:  ../20200315182349.GL467@hermes.hilbert.loc/
Also on:    postgresql.org/message-id/20200315182349.GL467@hermes.hilbert.loc

 · 

reply

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: Karsten.Hilbert@gmx.net
  Subject: Re: unexpected chunk number 2 (expected 0) for toast value ... in pg_toast_18536
  In-Reply-To: <20200315182349.GL467@hermes.hilbert.loc>
  References: <20200315182349.GL467@hermes.hilbert.loc>

* 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