forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita03e3e1
committed
Prevent incorrect updates of pg_index while reindexing pg_index itself.
The places that attempt to change pg_index.indcheckxmin during a reindexingoperation cannot be executed safely if pg_index itself is the subject ofthe operation. This is the explanation for a couple of recent reports ofVACUUM FULL failing withERROR: duplicate key value violates unique constraint "pg_index_indexrelid_index"DETAIL: Key (indexrelid)=(2678) already exists.However, there isn't any real need to update indcheckxmin in such asituation, if we assume that pg_index can never contain a truly broken HOTchain. This assumption holds if new indexes are never created on it duringconcurrent operations, which is something we don't consider safe for anysystem catalog, not just pg_index. Accordingly, modify the code to notmanipulate indcheckxmin when reindexing any system catalog.Back-patch to 8.3, where HOT was introduced. The known failure scenariosinvolve 9.0-style VACUUM FULL, so there might not be any real risk before9.0, but let's not assume that.1 parentc1d4238 commita03e3e1
1 file changed
+24
-4
lines changedLines changed: 24 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1462 | 1462 |
| |
1463 | 1463 |
| |
1464 | 1464 |
| |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
1465 | 1472 |
| |
1466 | 1473 |
| |
1467 | 1474 |
| |
| |||
1521 | 1528 |
| |
1522 | 1529 |
| |
1523 | 1530 |
| |
1524 |
| - | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
1525 | 1538 |
| |
1526 | 1539 |
| |
1527 | 1540 |
| |
| |||
1698 | 1711 |
| |
1699 | 1712 |
| |
1700 | 1713 |
| |
1701 |
| - | |
| 1714 | + | |
| 1715 | + | |
1702 | 1716 |
| |
1703 | 1717 |
| |
1704 | 1718 |
| |
| |||
1786 | 1800 |
| |
1787 | 1801 |
| |
1788 | 1802 |
| |
1789 |
| - | |
| 1803 | + | |
| 1804 | + | |
1790 | 1805 |
| |
1791 | 1806 |
| |
1792 | 1807 |
| |
| |||
2481 | 2496 |
| |
2482 | 2497 |
| |
2483 | 2498 |
| |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
2484 | 2504 |
| |
2485 |
| - | |
| 2505 | + | |
2486 | 2506 |
| |
2487 | 2507 |
| |
2488 | 2508 |
| |
|
0 commit comments
Comments
(0)