forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commit706054b
committed
Ensure we have a snapshot when updating various system catalogs.
A few places that access system catalogs don't set up an activesnapshot before potentially accessing their TOAST tables. To fix,push an active snapshot just before each section of code that mightrequire accessing one of these TOAST tables, and pop it shortlyafterwards. While at it, this commit adds some rather strictassertions in an attempt to prevent such issues in the future.Commit16bf24e recently removed pg_replication_origin's TOASTtable in order to fix the same problem for that catalog. On theback-branches, those bugs are left in place. We cannot easilyremove a catalog's TOAST table on released major versions, and onlyreplication origins with extremely long names are affected. Giventhe low severity of the issue, fixing older versions doesn't seemworth the trouble of significantly modifying the patch.Also, on v13 and v14, the aforementioned strict assertions havebeen omitted because commit2776922, which addedHaveRegisteredOrActiveSnapshot(), was not back-patched. While wecould probably back-patch it now, I've opted against it because itseems unlikely that new TOAST snapshot issues will be introduced inthe oldest supported versions.Reported-by: Alexander Lakhin <exclusion@gmail.com>Reviewed-by: Michael Paquier <michael@paquier.xyz>Discussion:https://postgr.es/m/18127-fe54b6a667f29658%40postgresql.orgDiscussion:https://postgr.es/m/18309-c0bf914950c46692%40postgresql.orgDiscussion:https://postgr.es/m/ZvMSUPOqUU-VNADN%40nathanBackpatch-through: 131 parent232d8ca commit706054b
File tree
5 files changed
+69
-1
lines changed- src/backend
- access/heap
- commands
- postmaster
- replication/logical
5 files changed
+69
-1
lines changedLines changed: 29 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
213 | 213 |
| |
214 | 214 |
| |
215 | 215 |
| |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
216 | 237 |
| |
217 | 238 |
| |
218 | 239 |
| |
| |||
2066 | 2087 |
| |
2067 | 2088 |
| |
2068 | 2089 |
| |
| 2090 | + | |
| 2091 | + | |
2069 | 2092 |
| |
2070 | 2093 |
| |
2071 | 2094 |
| |
| |||
2343 | 2366 |
| |
2344 | 2367 |
| |
2345 | 2368 |
| |
| 2369 | + | |
| 2370 | + | |
2346 | 2371 |
| |
2347 | 2372 |
| |
2348 | 2373 |
| |
| |||
2765 | 2790 |
| |
2766 | 2791 |
| |
2767 | 2792 |
| |
| 2793 | + | |
| 2794 | + | |
2768 | 2795 |
| |
2769 | 2796 |
| |
2770 | 2797 |
| |
| |||
3260 | 3287 |
| |
3261 | 3288 |
| |
3262 | 3289 |
| |
| 3290 | + | |
| 3291 | + | |
3263 | 3292 |
| |
3264 | 3293 |
| |
3265 | 3294 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4226 | 4226 |
| |
4227 | 4227 |
| |
4228 | 4228 |
| |
4229 |
| - | |
| 4229 | + | |
4230 | 4230 |
| |
4231 | 4231 |
| |
4232 | 4232 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20964 | 20964 |
| |
20965 | 20965 |
| |
20966 | 20966 |
| |
| 20967 | + | |
| 20968 | + | |
| 20969 | + | |
| 20970 | + | |
| 20971 | + | |
| 20972 | + | |
20967 | 20973 |
| |
20968 | 20974 |
| |
20969 | 20975 |
| |
| 20976 | + | |
| 20977 | + | |
20970 | 20978 |
| |
20971 | 20979 |
| |
20972 | 20980 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2234 | 2234 |
| |
2235 | 2235 |
| |
2236 | 2236 |
| |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
2237 | 2243 |
| |
2238 | 2244 |
| |
2239 | 2245 |
| |
| |||
2246 | 2252 |
| |
2247 | 2253 |
| |
2248 | 2254 |
| |
| 2255 | + | |
2249 | 2256 |
| |
2250 | 2257 |
| |
2251 | 2258 |
| |
|
Lines changed: 24 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4626 | 4626 |
| |
4627 | 4627 |
| |
4628 | 4628 |
| |
| 4629 | + | |
| 4630 | + | |
| 4631 | + | |
| 4632 | + | |
| 4633 | + | |
| 4634 | + | |
| 4635 | + | |
4629 | 4636 |
| |
4630 | 4637 |
| |
| 4638 | + | |
4631 | 4639 |
| |
4632 | 4640 |
| |
4633 | 4641 |
| |
| |||
4843 | 4851 |
| |
4844 | 4852 |
| |
4845 | 4853 |
| |
| 4854 | + | |
| 4855 | + | |
| 4856 | + | |
| 4857 | + | |
| 4858 | + | |
| 4859 | + | |
| 4860 | + | |
4846 | 4861 |
| |
| 4862 | + | |
4847 | 4863 |
| |
4848 | 4864 |
| |
4849 | 4865 |
| |
| |||
4947 | 4963 |
| |
4948 | 4964 |
| |
4949 | 4965 |
| |
| 4966 | + | |
| 4967 | + | |
| 4968 | + | |
| 4969 | + | |
| 4970 | + | |
| 4971 | + | |
4950 | 4972 |
| |
4951 | 4973 |
| |
4952 | 4974 |
| |
| |||
5005 | 5027 |
| |
5006 | 5028 |
| |
5007 | 5029 |
| |
| 5030 | + | |
| 5031 | + | |
5008 | 5032 |
| |
5009 | 5033 |
| |
5010 | 5034 |
| |
|
0 commit comments
Comments
(0)