Bug about drop index concurrently - Mailing list pgsql-hackers
From | 李杰(慎追) |
---|---|
Subject | Bug about drop index concurrently |
Date | |
Msg-id | cd1b1f74-b3ba-4df7-9355-9df2057b7724.adger.lj@alibaba-inc.com Whole thread Raw |
Responses |
Re: Bug about drop index concurrently
|
List | pgsql-hackers |
postgres=# explain analyze select * from xxx where a=500;
ERROR: could not open relation with OID 25989
The structure of my table is as follows:
postgres=# \d xxx
Table "public.xxx"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------
a | integer | | |
b | text | | |
postgres=# select count(*) from xxx;
count
--------
800000
(1 row)
postgres=# select * from xxx limit 3;
a | b
---+----------------------------------
1 | 203c51477570aa517cfa317155dcc52c
2 | b58da31baa5c78fee4642fd398bd5909
3 | c7c475bf0a3ca2fc2afc4812a4d44c58
postgres=# drop index CONCURRENTLY idx_xxx ;
DROP INDEX
postgres=# create index idx_xxx on xxx (a);
postgres=# drop index CONCURRENTLY idx_xxx ;
postgres=# create index idx_xxx on xxx (a);
postgres=# drop index CONCURRENTLY idx_xxx ;
...
...
...
At the same time, I started two clients in the standby,
respectively execute the following sql on the table xxx:
postgres=# explain analyze select * from xxx where a=500;
postgres=# \watch 0.1
After a few minutes, the bug will appear.
I think this is a bug that will affect the user's experience. we need to fix it.
I have imagined that the logic that detects the query transaction and
waits for it to end is implemented on the standby,but this may increase the
log application delay and the delay is exacerbated that cause the master and backup.
This is not desirable if the query concurrency is large.
All in all, I expect that you can provide a solution that can use drop index concurrently
without affecting the master-slave delay.
Sincerely look forward to your reply and thanks.
adger
pgsql-hackers by date: