forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit38ea6aa
committed
Fix updates of indisvalid for partitioned indexes
indisvalid is switched to true for partitioned indexes when all itspartitions have valid indexes when attaching a new partition, up to thetop-most parent if all its leaves are themselves valid when dealing withmultiple layers of partitions.The copy of the tuple from pg_index used to switch indisvalid to truecame from the relation cache, which is incorrect. Particularly, in thecase reported by Shruthi Gowda, executing a series of commands in asingle transaction would cause the validation of partitioned indexes touse an incorrect version of a pg_index tuple, as indexes are reloadedafter an invalidation request with RelationReloadIndexInfo(), a muchfaster version than a full index cache rebuild. In this case, thelimited information updated in the cache leads to an incorrect versionof the tuple used. One of the symptoms reported was the followingerror, with a replica identity update, for instance:"ERROR: attempted to update invisible tuple"This is incorrect since8b08f7d, so backpatch all the way down.Reported-by: Shruthi GowdaAuthor: Michael PaquierReviewed-by: Shruthi Gowda, Dilip KumarDiscussion:https://postgr.es/m/CAASxf_PBcxax0wW-3gErUyftZ0XrCs3Lrpuhq4-Z3Fak1DoW7Q@mail.gmail.comBackpatch-through: 111 parentd0c2860 commit38ea6aa
File tree
3 files changed
+117
-4
lines changed- src
- backend/commands
- test/regress
- expected
- sql
3 files changed
+117
-4
lines changedLines changed: 11 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
19174 | 19174 |
| |
19175 | 19175 |
| |
19176 | 19176 |
| |
19177 |
| - | |
| 19177 | + | |
| 19178 | + | |
19178 | 19179 |
| |
19179 | 19180 |
| |
| 19181 | + | |
| 19182 | + | |
| 19183 | + | |
| 19184 | + | |
| 19185 | + | |
| 19186 | + | |
19180 | 19187 |
| |
19181 |
| - | |
19182 |
| - | |
| 19188 | + | |
19183 | 19189 |
| |
19184 | 19190 |
| |
19185 |
| - | |
| 19191 | + | |
19186 | 19192 |
| |
19187 | 19193 |
| |
| 19194 | + | |
19188 | 19195 |
| |
19189 | 19196 |
| |
19190 | 19197 |
| |
|
Lines changed: 63 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1537 | 1537 |
| |
1538 | 1538 |
| |
1539 | 1539 |
| |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + |
Lines changed: 43 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
855 | 855 |
| |
856 | 856 |
| |
857 | 857 |
| |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + |
0 commit comments
Comments
(0)