- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit3137b49
committed
Fix possible page corruption by ALTER TABLE .. SET TABLESPACE.
If a zeroed page is present in the heap, ALTER TABLE .. SET TABLESPACE willset the LSN and TLI while copying it, which is wrong, and heap_xlog_newpage()will do the same thing during replay, so the corruption propagates to anystandby. Note, however, that the bug can't be demonstrated unless archivingis enabled, since in that case we skip WAL logging altogether, and the LSN/TLIare not set.Back-patch to 8.0; prior releases do not have tablespaces.Analysis and patch by Jeff Davis. Adjustments for back-branches and minorwordsmithing by me.1 parent5a54266 commit3137b49
2 files changed
+21
-6
lines changedLines changed: 11 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
2304 | 2304 |
| |
2305 | 2305 |
| |
2306 | 2306 |
| |
2307 |
| - | |
2308 |
| - | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
2309 | 2317 |
| |
2310 | 2318 |
| |
2311 | 2319 |
| |
|
Lines changed: 10 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
5786 | 5786 |
| |
5787 | 5787 |
| |
5788 | 5788 |
| |
5789 |
| - | |
5790 |
| - | |
| 5789 | + | |
| 5790 | + | |
| 5791 | + | |
| 5792 | + | |
| 5793 | + | |
| 5794 | + | |
| 5795 | + | |
| 5796 | + | |
| 5797 | + | |
5791 | 5798 |
| |
5792 | 5799 |
| |
5793 | 5800 |
| |
|
0 commit comments
Comments
(0)