forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4c9d090
committed
Correct predicate locking for DROP INDEX CONCURRENTLY.
For the non-concurrent case there is an AccessExclusiveLock lockon both the index and the heap at a time during which no otherprocess is using either, before which the index is maintained andused for scans, and after which the index is no longer used ormaintained. Predicate locks can safely be moved from the index tothe related heap relation under the protection of these locks.This was done prior to the introductin of DROP INDEX CONCURRENTLYand continues to be done for non-concurrent index drops.For concurrent index drops, the predicate locks must be moved whenthere are no index scans in progress on that index and no more cansubsequently start, and before heap inserts stop maintaining theindex. As long as these conditions are guaranteed when theTransferPredicateLocksToHeapRelation() function is called,stronger locks are not needed for correctness.Kevin Grittner based on questions by Tom Lane in reviewing theDROP INDEX CONCURRENTLY patch and in cooperation with AndresFreund and Simon Riggs.1 parentedef20f commit4c9d090
1 file changed
+22
-6
lines changedLines changed: 22 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1320 | 1320 |
| |
1321 | 1321 |
| |
1322 | 1322 |
| |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
1323 | 1335 |
| |
1324 | 1336 |
| |
1325 | 1337 |
| |
| |||
1444 | 1456 |
| |
1445 | 1457 |
| |
1446 | 1458 |
| |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
1447 | 1467 |
| |
1448 | 1468 |
| |
1449 | 1469 |
| |
| |||
1514 | 1534 |
| |
1515 | 1535 |
| |
1516 | 1536 |
| |
1517 |
| - | |
1518 |
| - | |
1519 |
| - | |
1520 |
| - | |
1521 |
| - | |
1522 |
| - | |
| 1537 | + | |
| 1538 | + | |
1523 | 1539 |
| |
1524 | 1540 |
| |
1525 | 1541 |
| |
|
0 commit comments
Comments
(0)