Re: 'CLUSTER' in one database prevents running it in two others on the same database cluster (PG15.2) - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: 'CLUSTER' in one database prevents running it in two others on the same database cluster (PG15.2)
Date
Msg-id 20230307112547.imnavuk4ejxchvx2@alvherre.pgsql
Whole thread Raw
In response to 'CLUSTER' in one database prevents running it in two others on the same database cluster (PG15.2)  (Marco Boeringa <marco@boeringa.demon.nl>)
List pgsql-bugs
On 2023-Mar-05, Marco Boeringa wrote:

> However, as part of two secondary Python scripts running that do all kinds
> of batch operations against spatial tables (generalization and such) in two
> other databases on the same database cluster, at the very end of the
> processing, these initialize 'CLUSTER' operations as well. Both of these now
> fail with a:
>     "missing chunk number 0 for toast value X in pg_toast_Y"
> type error.

Hmm.  Very strange ...

> After these errors, I see the CLUSTER command listed as well in the
> PostgreSQL main log, but the ERROR line mentioned above is listed just above
> the actual CLUSTER statement in the log. No other anomaly / error is visible
> there. The CLUSTER command just fails though on the two secondary databases.
> The time displayed in the log is exactly the same for these two log lines
> one after another, also the number between the square brackets listed
> immediately after the "CET" of the time are the same for the same database.

It would make things much more understandable if you just pasted the log
lines, instead of describing details of those log lines.  In you
description you may omit clues that may seem trivial/unimportant to you
but indicate useful things to us.

One thing that I'm curious about is what the various values of 'Y' are
in these lines:

> The pg_toast_Y table names mentioned in the errors differ by the way between
> the two databases.

It would be useful if you could look up to what heap-table each of these
TOAST tables correspond, with a query like
   SELECT oid::regclass FROM pg_class WHERE reltoastrelid = 'pg_toast.pg_toast_Y'::regclass;
(ran in the database that each error was thrown from.)

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"Learn about compilers. Then everything looks like either a compiler or
a database, and now you have two problems but one of them is fun."
            https://twitter.com/thingskatedid/status/1456027786158776329



pgsql-bugs by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: BUG #17798: Incorrect memory access occurs when using BEFORE ROW UPDATE trigger
Next
From: Alvaro Herrera
Date:
Subject: Re: BUG #17809: MERGE ... UPDATE fails with BEFORE ROW UPDATE trigger when target row updated concurrently