forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita8b330f
committed
Fix dsa.c with different resource owners.
The comments in dsa.c suggested that areas were owned by resourceowners, but it was not in fact tracked explicitly. The DSM attachmentsheld by the dsa were owned by resource owners, but not the areaitself. That led to confusion if you used one resource owner toattach or create the area, but then switched to a different resourceowner before allocating or even just accessing the allocations in thearea with dsa_get_address(). The additional DSM segments associatedwith the area would get owned by a different resource owner than theinitial segment. To fix, add an explicit 'resowner' field todsa_area. It replaces the 'mapping_pinned' flag; resowner == NULL nowindicates that the mapping is pinned.This is arguably a bug fix, but I'm not backpatching because itdoesn't seem to be a live bug in the back branches. In 'master', it isa bug because commitb8bff07 made ResourceOwners more strict sothat you are no longer allowed to remember new resources in aResourceOwner after you have started to release it. Merely accessing adsa pointer might need to attach a new DSM segment, and before thiscommit it was temporarily remembered in the current owner for a verybrief period even if the DSA was pinned. And that could happen inAtEOXact_PgStat(), which is called after the owner is already released.Reported-by: Alexander LakhinReviewed-by: Alexander Lakhin, Thomas Munro, Andres FreundDiscussion:https://www.postgresql.org/message-id/11b70743-c5f3-3910-8e5b-dd6c115ff829%40gmail.com1 parentf26c236 commita8b330f
1 file changed
+25
-13
lines changedLines changed: 25 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
59 | 59 |
| |
60 | 60 |
| |
61 | 61 |
| |
| 62 | + | |
62 | 63 |
| |
63 | 64 |
| |
64 | 65 |
| |
| |||
368 | 369 |
| |
369 | 370 |
| |
370 | 371 |
| |
371 |
| - | |
372 |
| - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
373 | 379 |
| |
374 | 380 |
| |
375 | 381 |
| |
| |||
645 | 651 |
| |
646 | 652 |
| |
647 | 653 |
| |
648 |
| - | |
649 |
| - | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
650 | 657 |
| |
651 |
| - | |
652 |
| - | |
653 |
| - | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
654 | 662 |
| |
655 | 663 |
| |
656 | 664 |
| |
| |||
1264 | 1272 |
| |
1265 | 1273 |
| |
1266 | 1274 |
| |
1267 |
| - | |
| 1275 | + | |
1268 | 1276 |
| |
1269 | 1277 |
| |
1270 | 1278 |
| |
| |||
1320 | 1328 |
| |
1321 | 1329 |
| |
1322 | 1330 |
| |
1323 |
| - | |
| 1331 | + | |
1324 | 1332 |
| |
1325 | 1333 |
| |
1326 | 1334 |
| |
| |||
1743 | 1751 |
| |
1744 | 1752 |
| |
1745 | 1753 |
| |
| 1754 | + | |
1746 | 1755 |
| |
1747 | 1756 |
| |
1748 | 1757 |
| |
| |||
1761 | 1770 |
| |
1762 | 1771 |
| |
1763 | 1772 |
| |
| 1773 | + | |
| 1774 | + | |
1764 | 1775 |
| |
| 1776 | + | |
1765 | 1777 |
| |
1766 | 1778 |
| |
1767 |
| - | |
1768 |
| - | |
1769 | 1779 |
| |
1770 | 1780 |
| |
1771 | 1781 |
| |
| |||
2067 | 2077 |
| |
2068 | 2078 |
| |
2069 | 2079 |
| |
| 2080 | + | |
2070 | 2081 |
| |
2071 | 2082 |
| |
2072 | 2083 |
| |
| |||
2151 | 2162 |
| |
2152 | 2163 |
| |
2153 | 2164 |
| |
| 2165 | + | |
| 2166 | + | |
2154 | 2167 |
| |
| 2168 | + | |
2155 | 2169 |
| |
2156 | 2170 |
| |
2157 | 2171 |
| |
2158 |
| - | |
2159 |
| - | |
2160 | 2172 |
| |
2161 | 2173 |
| |
2162 | 2174 |
| |
|
0 commit comments
Comments
(0)