v12.0: interrupt reindex CONCURRENTLY: ccold: ERROR: could not find tuple for parent of relation ...

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Andreas Karlsson <andreas(at)proxel(dot)se>
Subject: v12.0: interrupt reindex CONCURRENTLY: ccold: ERROR: could not find tuple for parent of relation ...
Date: 2019-10-15 16:40:47
Message-ID: 20191015164047.GA22729@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On a badly-overloaded VM, we hit the previously-reported segfault in progress
reporting. This left around some *ccold indices. I tried to drop them but:

sentinel=# DROP INDEX child.alarms_null_alarm_id_idx1_ccold; -- child.alarms_null_alarm_time_idx_ccold; -- alarms_null_alarm_id_idx_ccold;
ERROR: could not find tuple for parent of relation 41351896

Those are children of relkind=I index on relkind=p table.

postgres=# CREATE TABLE t(i int)PARTITION BY RANGE(i);
postgres=# CREATE TABLE t1 PARTITION OF t FOR VALUES FROM (1)TO(100);
postgres=# INSERT INTO t1 SELECT 1 FROM generate_series(1,99999);
postgres=# CREATE INDEX ON t(i);

postgres=# begin; SELECT * FROM t; -- DO THIS IN ANOTHER SESSION

postgres=# REINDEX INDEX CONCURRENTLY t1_i_idx; -- cancel this one
^CCancel request sent
ERROR: canceling statement due to user request

postgres=# \d t1
...
"t1_i_idx" btree (i)
"t1_i_idx_ccold" btree (i) INVALID

postgres=# SELECT inhrelid::regclass FROM pg_inherits WHERE inhparent='t_i_idx'::regclass;
inhrelid
t1_i_idx
(1 row)

Not only can't I DROP the _ccold indexes, but also dropping the table doesn't
cause them to be dropped, and then I can't even slash dee them anymore:

jtp=# DROP INDEX t1_i_idx_ccold;
ERROR: could not find tuple for parent of relation 290818869

jtp=# DROP TABLE t; -- does not fail, but ..

jtp=# \d t1_i_idx_ccold
ERROR: cache lookup failed for relation 290818865

jtp=# SELECT indrelid::regclass, * FROM pg_index WHERE indexrelid='t1_i_idx_ccold'::regclass;
indrelid | 290818865
indexrelid | 290818869
indrelid | 290818865
[...]

Justin

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Lewis 2019-10-15 16:43:50 Re: BRIN index which is much faster never chosen by planner
Previous Message Jeremy Finzel 2019-10-15 16:05:13 Re: BRIN index which is much faster never chosen by planner