forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit246f136
committed
Improve handling of parameter differences in physical replication
When certain parameters are changed on a physical replication primary,this is communicated to standbys using the XLOG_PARAMETER_CHANGE WALrecord. The standby then checks whether its own settings are at leastas big as the ones on the primary. If not, the standby shuts downwith a fatal error.The correspondence of settings between primary and standby is requiredbecause those settings influence certain shared memory sizings thatare required for processing WAL records that the primary might send.For example, if the primary sends a prepared transaction, the standbymust have had max_prepared_transaction set appropriately or it won'tbe able to process those WAL records.However, fatally shutting down the standby immediately upon receipt ofthe parameter change record might be a bit of an overreaction. Theresources related to those settings are not required immediately atthat point, and might never be required if the activity on the primarydoes not exhaust all those resources. If we just let the standby rollon with recovery, it will eventually produce an appropriate error whenthose resources are used.So this patch relaxes this a bit. Upon receipt ofXLOG_PARAMETER_CHANGE, we still check the settings but only issue awarning and set a global flag if there is a problem. Then when weactually hit the resource issue and the flag was set, we issue anotherwarning message with relevant information. At that point we pauserecovery, so a hot standby remains usable. We also repeat the lastwarning message once a minute so it is harder to miss or ignore.Reviewed-by: Sergei Kornilov <sk@zsrv.org>Reviewed-by: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>Discussion:https://www.postgresql.org/message-id/flat/4ad69a4c-cc9b-0dfe-0352-8b1b0cd36c7b@2ndquadrant.com1 parenta01e1b8 commit246f136
File tree
6 files changed
+122
-23
lines changed- doc/src/sgml
- src
- backend
- access/transam
- storage
- ipc
- lmgr
- include/access
6 files changed
+122
-23
lines changedLines changed: 36 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2148 | 2148 |
| |
2149 | 2149 |
| |
2150 | 2150 |
| |
2151 |
| - | |
2152 |
| - | |
2153 |
| - | |
2154 |
| - | |
2155 |
| - | |
2156 |
| - | |
2157 |
| - | |
2158 |
| - | |
2159 |
| - | |
2160 |
| - | |
2161 |
| - | |
2162 |
| - | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
2163 | 2159 |
| |
2164 | 2160 |
| |
2165 | 2161 |
| |
| |||
2188 | 2184 |
| |
2189 | 2185 |
| |
2190 | 2186 |
| |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
2191 | 2215 |
| |
2192 | 2216 |
| |
2193 | 2217 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2360 | 2360 |
| |
2361 | 2361 |
| |
2362 | 2362 |
| |
| 2363 | + | |
| 2364 | + | |
2363 | 2365 |
| |
2364 | 2366 |
| |
2365 | 2367 |
| |
2366 | 2368 |
| |
2367 | 2369 |
| |
| 2370 | + | |
2368 | 2371 |
| |
2369 | 2372 |
| |
2370 | 2373 |
| |
|
Lines changed: 64 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
264 | 264 |
| |
265 | 265 |
| |
266 | 266 |
| |
| 267 | + | |
| 268 | + | |
267 | 269 |
| |
268 | 270 |
| |
269 | 271 |
| |
| |||
5998 | 6000 |
| |
5999 | 6001 |
| |
6000 | 6002 |
| |
| 6003 | + | |
| 6004 | + | |
| 6005 | + | |
| 6006 | + | |
| 6007 | + | |
| 6008 | + | |
| 6009 | + | |
| 6010 | + | |
| 6011 | + | |
| 6012 | + | |
| 6013 | + | |
| 6014 | + | |
| 6015 | + | |
| 6016 | + | |
| 6017 | + | |
| 6018 | + | |
| 6019 | + | |
| 6020 | + | |
| 6021 | + | |
| 6022 | + | |
| 6023 | + | |
| 6024 | + | |
| 6025 | + | |
| 6026 | + | |
| 6027 | + | |
| 6028 | + | |
| 6029 | + | |
| 6030 | + | |
| 6031 | + | |
| 6032 | + | |
| 6033 | + | |
| 6034 | + | |
| 6035 | + | |
| 6036 | + | |
| 6037 | + | |
| 6038 | + | |
| 6039 | + | |
| 6040 | + | |
| 6041 | + | |
| 6042 | + | |
| 6043 | + | |
| 6044 | + | |
| 6045 | + | |
| 6046 | + | |
| 6047 | + | |
| 6048 | + | |
| 6049 | + | |
| 6050 | + | |
6001 | 6051 |
| |
6002 | 6052 |
| |
6003 | 6053 |
| |
| |||
6177 | 6227 |
| |
6178 | 6228 |
| |
6179 | 6229 |
| |
6180 |
| - | |
6181 |
| - | |
6182 |
| - | |
6183 |
| - | |
6184 |
| - | |
6185 |
| - | |
6186 |
| - | |
6187 |
| - | |
6188 |
| - | |
6189 |
| - | |
| 6230 | + | |
| 6231 | + | |
| 6232 | + | |
| 6233 | + | |
| 6234 | + | |
| 6235 | + | |
| 6236 | + | |
| 6237 | + | |
| 6238 | + | |
| 6239 | + | |
| 6240 | + | |
| 6241 | + | |
| 6242 | + | |
| 6243 | + | |
6190 | 6244 |
| |
6191 | 6245 |
| |
6192 | 6246 |
| |
|
Lines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3654 | 3654 |
| |
3655 | 3655 |
| |
3656 | 3656 |
| |
3657 |
| - | |
| 3657 | + | |
| 3658 | + | |
| 3659 | + | |
| 3660 | + | |
| 3661 | + | |
| 3662 | + | |
| 3663 | + | |
| 3664 | + | |
3658 | 3665 |
| |
3659 | 3666 |
| |
3660 | 3667 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
965 | 965 |
| |
966 | 966 |
| |
967 | 967 |
| |
| 968 | + | |
| 969 | + | |
968 | 970 |
| |
969 | 971 |
| |
970 | 972 |
| |
971 | 973 |
| |
| 974 | + | |
972 | 975 |
| |
973 | 976 |
| |
974 | 977 |
| |
| |||
1003 | 1006 |
| |
1004 | 1007 |
| |
1005 | 1008 |
| |
| 1009 | + | |
| 1010 | + | |
1006 | 1011 |
| |
1007 | 1012 |
| |
1008 | 1013 |
| |
1009 | 1014 |
| |
| 1015 | + | |
1010 | 1016 |
| |
1011 | 1017 |
| |
1012 | 1018 |
| |
| |||
2828 | 2834 |
| |
2829 | 2835 |
| |
2830 | 2836 |
| |
| 2837 | + | |
2831 | 2838 |
| |
2832 | 2839 |
| |
2833 | 2840 |
| |
| |||
4158 | 4165 |
| |
4159 | 4166 |
| |
4160 | 4167 |
| |
| 4168 | + | |
4161 | 4169 |
| |
4162 | 4170 |
| |
4163 | 4171 |
| |
| |||
4223 | 4231 |
| |
4224 | 4232 |
| |
4225 | 4233 |
| |
| 4234 | + | |
4226 | 4235 |
| |
4227 | 4236 |
| |
4228 | 4237 |
| |
| |||
4515 | 4524 |
| |
4516 | 4525 |
| |
4517 | 4526 |
| |
| 4527 | + | |
4518 | 4528 |
| |
4519 | 4529 |
| |
4520 | 4530 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
287 | 287 |
| |
288 | 288 |
| |
289 | 289 |
| |
| 290 | + | |
290 | 291 |
| |
291 | 292 |
| |
292 | 293 |
| |
|
0 commit comments
Comments
(0)