forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdf4a056
committed
Add more error context to RestoreBlockImage() and consume it
On failure in restoring a block image, no details were provided, whileit is possible to see failure with an inconsistent record state, afailure in processing decompression or a failure in decompressionbecause a build does not support this option.RestoreBlockImage() is used in two code paths in the backend code,during recovery and when checking a page consistency after applyingmasking, and both places are changed to consume the error messageproduced by the internal routine when it returns a false status. Allthe error messages are reported under ERRCODE_INTERNAL_ERROR, that getsused also when attempting to access a page compressed by a methodnot supported by the build attempting the decompression. This issomething that can happen in core when doing physical replication withprimary and standby using inconsistent build options, for example.This routine is available since2c03216 and it has never provided anycontext about the error happening when it failed. This change isjustified even more after57aa5b2, that introduced compression of FPWsin WAL.Reported-by: Justin PrysbyAuthor: Michael PaquierDiscussion:https://postgr.es/m/20220905002320.GD31833@telsasoft.comBackpatch-through: 151 parentd977ffd commitdf4a056
File tree
3 files changed
+23
-7
lines changed- src/backend/access/transam
3 files changed
+23
-7
lines changedLines changed: 17 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2036 | 2036 |
| |
2037 | 2037 |
| |
2038 | 2038 |
| |
2039 |
| - | |
| 2039 | + | |
| 2040 | + | |
2040 | 2041 |
| |
2041 | 2042 |
| |
2042 | 2043 |
| |
| |||
2047 | 2048 |
| |
2048 | 2049 |
| |
2049 | 2050 |
| |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
2050 | 2056 |
| |
| 2057 | + | |
2051 | 2058 |
| |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
2052 | 2063 |
| |
| 2064 | + | |
2053 | 2065 |
| |
2054 | 2066 |
| |
2055 | 2067 |
| |
| |||
2072 | 2084 |
| |
2073 | 2085 |
| |
2074 | 2086 |
| |
2075 |
| - | |
| 2087 | + | |
2076 | 2088 |
| |
2077 | 2089 |
| |
2078 | 2090 |
| |
| |||
2089 | 2101 |
| |
2090 | 2102 |
| |
2091 | 2103 |
| |
2092 |
| - | |
| 2104 | + | |
2093 | 2105 |
| |
2094 | 2106 |
| |
2095 | 2107 |
| |
| |||
2098 | 2110 |
| |
2099 | 2111 |
| |
2100 | 2112 |
| |
2101 |
| - | |
| 2113 | + | |
2102 | 2114 |
| |
2103 | 2115 |
| |
2104 | 2116 |
| |
2105 | 2117 |
| |
2106 | 2118 |
| |
2107 | 2119 |
| |
2108 | 2120 |
| |
2109 |
| - | |
| 2121 | + | |
2110 | 2122 |
| |
2111 | 2123 |
| |
2112 | 2124 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2412 | 2412 |
| |
2413 | 2413 |
| |
2414 | 2414 |
| |
2415 |
| - | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
2416 | 2418 |
| |
2417 | 2419 |
| |
2418 | 2420 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
393 | 393 |
| |
394 | 394 |
| |
395 | 395 |
| |
396 |
| - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
397 | 399 |
| |
398 | 400 |
| |
399 | 401 |
| |
|
0 commit comments
Comments
(0)