- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit9511fb3
committed
Reset indisreplident for an invalid index in DROP INDEX CONCURRENTLY
A failure when dropping concurrently an index used in a replica identitycould leave in pg_index an index marked as !indisvalid andindisreplident. Reindexing this index would switch back indisvalid totrue, and if the replica identity of the parent relation was switched touse a different index, it would be possible to finish with more than oneindex marked as indisreplident. If that were to happen, this could messup with the relation cache as an incorrect index could be used for thereplica identity.Indexes marked as invalid are discarded as candidates for the replicaidentity, as of RelationGetIndexList(), so similarly to what is donewith indisclustered, resetting indisreplident when the index is markedas invalid keeps things consistent. REINDEX CONCURRENTLY's swappingalready resets the flag for the old index, while the new index inheritsthe value of the old index to-be-dropped, so only DROP INDEX was anissue.Even if this is a bug, the sequence able to reproduce a problem requiresa failure while running DROP INDEX CONCURRENTLY, something unlikelygoing to happen in the field, so no backpatch is done.Author: Michael PaquierReviewed-by: Dmitry DolgovDiscussion:https://postgr.es/m/20200827025721.GN2017@paquier.xyz1 parent7a1cd52 commit9511fb3
1 file changed
+7
-2
lines changedLines changed: 7 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1512 | 1512 |
| |
1513 | 1513 |
| |
1514 | 1514 |
| |
1515 |
| - | |
1516 | 1515 |
| |
1517 | 1516 |
| |
1518 | 1517 |
| |
| |||
1524 | 1523 |
| |
1525 | 1524 |
| |
1526 | 1525 |
| |
| 1526 | + | |
1527 | 1527 |
| |
1528 | 1528 |
| |
1529 | 1529 |
| |
| |||
3349 | 3349 |
| |
3350 | 3350 |
| |
3351 | 3351 |
| |
3352 |
| - | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
3353 | 3355 |
| |
3354 | 3356 |
| |
3355 | 3357 |
| |
| 3358 | + | |
3356 | 3359 |
| |
3357 | 3360 |
| |
3358 | 3361 |
| |
| |||
3364 | 3367 |
| |
3365 | 3368 |
| |
3366 | 3369 |
| |
| 3370 | + | |
| 3371 | + | |
3367 | 3372 |
| |
3368 | 3373 |
| |
3369 | 3374 |
| |
|
0 commit comments
Comments
(0)