PANIC: invalid index offnum: 186 when processing BRIN indexes in VACUUM
Tomas Vondra <tomas.vondra@2ndquadrant.com>
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: pgsql-hackers@postgresql.org
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2017-10-29T16:42:26Z
Lists: pgsql-hackers
Attachments
- brin-vacuum.txt (text/plain)
Hi,
while doing some weekend hacking & testing on the BRIN patches I posted
recently, I ran into PANICs in VACUUM, when it summarizes data inserted
concurrently (in another session):
PANIC: invalid index offnum: 186
Initially I thought it's a bug in my patches, but apparently it's not
and I can reproduce it easily on current master (846fcc8516).
I'm not sure if/how this is related to the BRIN autosummarization issue
reported by Justin Pryzby about two weeks ago (thread [1]), but I don't
see any segfaults and the messages are always exactly the same.
[1]
https://www.postgresql.org/message-id/flat/20171014035732.GB31726%40telsasoft.com
Reproducing the issue is simple:
create table brin_test (a int, b bigint, c float,
d double precision, e uuid);
create index on brin_test using brin (a);
create index on brin_test using brin (b);
create index on brin_test using brin (c);
create index on brin_test using brin (d);
create index on brin_test using brin (e);
and then run
insert into brin_test select
mod(i,100000)/25,
mod(i,100000)/25,
mod(i,100000)/25,
mod(i,100000)/25,
md5((mod(i,100000)/25)::text)::uuid
from generate_series(1,100000) s(i) \watch 0.1
vacuum brin_test \watch 1
And sooner or later (for me it only takes a minute or two in most cases)
the VACUUM session should fail with the PANIC message mentioned above.
It always fails with the message, only the value (offset) changes.
The stack trace always looks exactly the same - see the attachment.
At first it seemed the idxrel is always the index on 'e' (i.e. the UUID
column), but it seems I also got failures on the other indexes.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Fix BRIN summarization concurrent with extension
- ec42a1dcb30d 11.0 landed
- cf0612aa2c8f 9.5.10 landed
- bd8e2b3cf4cf 9.6.6 landed
- 37a856567c04 10.1 landed
-
Fix corner-case errors in brin_doupdate().
- 62a16572d571 11.0 landed
- a43cd427e703 9.6.6 landed
- 43276abc6f7e 9.5.10 landed
- 97ba7b8c87e1 10.1 landed
-
Rewrite PageIndexDeleteNoCompact into a form that only deletes 1 tuple.
- 24992c6db9fd 10.0 cited
-
Invent PageIndexTupleOverwrite, and teach BRIN and GiST to use it.
- b1328d78f88c 10.0 cited
-
Close some holes in BRIN page assignment
- ccc4c074994d 9.6.0 cited