forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commit9936f14
committed
Repair pg_upgrade's failure to preserve relfrozenxid for matviews.
This oversight led to data corruption in matviews, manifesting as"could not access status of transaction" before our most recent releases,and "found xmin from before relfrozenxid" errors since then.The proximate cause of the problem seems to have been confusion betweenthe task of preserving dropped-column status and the task of preservingfrozenxid status. Those are required for distinct sets of relkinds,and the reasoning was entirely undocumented in the source code. In hopesof forestalling future errors of the same kind, try to improve thecommentary in this area.In passing, also improve the remarkably unhelpful comments aroundpg_upgrade's set_frozenxids(). That's not actually buggy AFAICS,but good luck figuring out what it does from the old comments.Per report from Claudio Freire. It appears that bug #14852 from AlexeyErmakov is an earlier report of the same issue, and there may be othercases that we failed to identify at the time.Patch by me based on analysis by Andres Freund. The bug dates backto the introduction of matviews, so back-patch to all supported branches.Discussion:https://postgr.es/m/CAGTBQpbrY9CdRGGhyBZ9yqY4jWaGC85rUF4X+R7d-aim=mBNsw@mail.gmail.comDiscussion:https://postgr.es/m/20171013115320.28049.86457@wrigleys.postgresql.org1 parent340d63b commit9936f14
2 files changed
+47
-13
lines changedLines changed: 25 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14278 | 14278 |
| |
14279 | 14279 |
| |
14280 | 14280 |
| |
| 14281 | + | |
| 14282 | + | |
| 14283 | + | |
| 14284 | + | |
| 14285 | + | |
| 14286 | + | |
| 14287 | + | |
14281 | 14288 |
| |
14282 | 14289 |
| |
14283 | 14290 |
| |
| |||
14367 | 14374 |
| |
14368 | 14375 |
| |
14369 | 14376 |
| |
| 14377 | + | |
14370 | 14378 |
| |
| 14379 | + | |
| 14380 | + | |
| 14381 | + | |
| 14382 | + | |
| 14383 | + | |
| 14384 | + | |
| 14385 | + | |
| 14386 | + | |
| 14387 | + | |
| 14388 | + | |
| 14389 | + | |
14371 | 14390 |
| |
14372 | 14391 |
| |
14373 | 14392 |
| |
| |||
14378 | 14397 |
| |
14379 | 14398 |
| |
14380 | 14399 |
| |
14381 |
| - | |
| 14400 | + | |
| 14401 | + | |
| 14402 | + | |
| 14403 | + | |
14382 | 14404 |
| |
14383 | 14405 |
| |
14384 | 14406 |
| |
| |||
14392 | 14414 |
| |
14393 | 14415 |
| |
14394 | 14416 |
| |
14395 |
| - | |
| 14417 | + | |
| 14418 | + | |
14396 | 14419 |
| |
14397 | 14420 |
| |
14398 | 14421 |
| |
|
Lines changed: 22 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
272 | 272 |
| |
273 | 273 |
| |
274 | 274 |
| |
275 |
| - | |
276 |
| - | |
277 |
| - | |
| 275 | + | |
278 | 276 |
| |
279 |
| - | |
280 | 277 |
| |
281 | 278 |
| |
| 279 | + | |
| 280 | + | |
| 281 | + | |
282 | 282 |
| |
283 | 283 |
| |
284 | 284 |
| |
| |||
496 | 496 |
| |
497 | 497 |
| |
498 | 498 |
| |
499 |
| - | |
500 |
| - | |
501 |
| - | |
502 |
| - | |
503 |
| - | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
504 | 516 |
| |
505 |
| - | |
506 |
| - | |
| 517 | + | |
507 | 518 |
| |
508 | 519 |
| |
509 | 520 |
| |
|
0 commit comments
Comments
(0)