Re: BUG #15672: PostgreSQL 11.1/11.2 crashed after dropping a partition table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Amit Langote <amitlangote09(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, jianingy(dot)yang(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: BUG #15672: PostgreSQL 11.1/11.2 crashed after dropping a partition table
Date: 2019-04-23 22:03:05
Message-ID: 695.1556056985@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

ISTM we could work around the problem with the attached, which I think
is a good change independently of anything else.

There is still an issue, which manifests in both 11 and HEAD, namely
that the code also propagates the parent index's comment to any child
indexes. You can see that with this extended test case:

create table users(user_id int, name varchar(64), unique (user_id, name)) partition by hash(user_id);
comment on index users_user_id_name_key is 'parent index';
create table users_000 partition of users for values with (modulus 2, remainder 0);
create table users_001 partition of users for values with (modulus 2, remainder 1);

select relname, relfilenode, obj_description(oid,'pg_class') from pg_class where relname like 'users%';
alter table users alter column name type varchar(127);
select relname, relfilenode, obj_description(oid,'pg_class') from pg_class where relname like 'users%';

which gives me (in 11, with this patch)

...
relname | relfilenode | obj_description
----------------------------+-------------+-----------------
users | 89389 |
users_000 | 89394 |
users_000_user_id_name_key | 89397 |
users_001 | 89399 |
users_001_user_id_name_key | 89402 |
users_user_id_name_key | 89392 | parent index
(6 rows)

ALTER TABLE
relname | relfilenode | obj_description
----------------------------+-------------+-----------------
users | 89389 |
users_000 | 89394 |
users_000_user_id_name_key | 89406 | parent index
users_001 | 89399 |
users_001_user_id_name_key | 89408 | parent index
users_user_id_name_key | 89404 | parent index
(6 rows)

However, I doubt that that's bad enough to justify a major rewrite
of the ALTER TABLE code in 11 ... and maybe not in HEAD either;
I wouldn't be too unhappy to leave it to v13.

regards, tom lane

Attachment Content-Type Size
dont-try-to-share-storage-thats-not-there.patch text/x-diff 850 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tatsuo Ishii 2019-04-23 22:39:20 Re: BUG #15776: Pgpool
Previous Message Jonathan S. Katz 2019-04-23 18:30:31 Re: BUG #15776: Pgpool

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2019-04-23 22:07:25 Re: TM format can mix encodings in to_char()
Previous Message Alvaro Herrera 2019-04-23 21:17:52 Re: REINDEX INDEX results in a crash for an index of pg_class since 9.6