forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdd38ff2
committed
Fix recovery_prefetch with low maintenance_io_concurrency.
We should process completed IOs *before* trying to start more, so thatit is always possible to decode one more record when the decoded recordqueue is empty, even if maintenance_io_concurrency is set so low that asingle earlier WAL record might have saturated the IO queue.That bug was hidden because the effect of maintenance_io_concurrency wasarbitrarily clamped to be at least 2. Fix the ordering, and also removethat clamp. We need a special case for 0, which is now treated the sameas recovery_prefetch=off, but otherwise the number is used directly.This allows for testing with 1, which would have made the problemobvious in simple test scenarios.Also add an explicit error message for missing contrecords. It was abit strange that we didn't report an error already, and became a latentbug with prefetching, since the internal state that tracks abortedcontrecords would not survive retrying, as revealed by026_overwrite_contrecord.pl with this adjustment. Reporting an errorprevents that.Back-patch to 15.Reported-by: Justin Pryzby <pryzby@telsasoft.com>Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>Discussion:https://postgr.es/m/20220831140128.GS31833%40telsasoft.com1 parent144cefa commitdd38ff2
File tree
3 files changed
+56
-23
lines changed- src
- backend/access/transam
- include/access
3 files changed
+56
-23
lines changedLines changed: 36 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
72 | 72 |
| |
73 | 73 |
| |
74 | 74 |
| |
75 |
| - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
76 | 78 |
| |
77 | 79 |
| |
78 | 80 |
| |
| |||
983 | 985 |
| |
984 | 986 |
| |
985 | 987 |
| |
| 988 | + | |
986 | 989 |
| |
987 | 990 |
| |
988 | 991 |
| |
| |||
998 | 1001 |
| |
999 | 1002 |
| |
1000 | 1003 |
| |
1001 |
| - | |
| 1004 | + | |
| 1005 | + | |
1002 | 1006 |
| |
1003 | 1007 |
| |
1004 | 1008 |
| |
| |||
1016 | 1020 |
| |
1017 | 1021 |
| |
1018 | 1022 |
| |
1019 |
| - | |
1020 |
| - | |
| 1023 | + | |
| 1024 | + | |
1021 | 1025 |
| |
1022 |
| - | |
| 1026 | + | |
1023 | 1027 |
| |
1024 |
| - | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
1025 | 1045 |
| |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
1026 | 1049 |
| |
| 1050 | + | |
1027 | 1051 |
| |
1028 | 1052 |
| |
1029 | 1053 |
| |
| |||
1037 | 1061 |
| |
1038 | 1062 |
| |
1039 | 1063 |
| |
1040 |
| - | |
1041 |
| - | |
1042 |
| - | |
1043 |
| - | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
1044 | 1068 |
| |
1045 |
| - | |
| 1069 | + | |
| 1070 | + | |
1046 | 1071 |
| |
1047 | 1072 |
| |
1048 | 1073 |
| |
| |||
1051 | 1076 |
| |
1052 | 1077 |
| |
1053 | 1078 |
| |
1054 |
| - | |
1055 |
| - | |
1056 |
| - | |
1057 |
| - | |
1058 |
| - | |
1059 |
| - | |
1060 |
| - | |
1061 | 1079 |
| |
1062 | 1080 |
| |
1063 | 1081 |
| |
|
Lines changed: 19 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
275 | 275 |
| |
276 | 276 |
| |
277 | 277 |
| |
278 |
| - | |
279 |
| - | |
| 278 | + | |
| 279 | + | |
280 | 280 |
| |
281 |
| - | |
| 281 | + | |
282 | 282 |
| |
283 | 283 |
| |
284 | 284 |
| |
| 285 | + | |
285 | 286 |
| |
286 | 287 |
| |
287 |
| - | |
| 288 | + | |
288 | 289 |
| |
289 | 290 |
| |
290 | 291 |
| |
291 | 292 |
| |
292 | 293 |
| |
293 | 294 |
| |
| 295 | + | |
294 | 296 |
| |
295 | 297 |
| |
296 | 298 |
| |
| |||
336 | 338 |
| |
337 | 339 |
| |
338 | 340 |
| |
| 341 | + | |
| 342 | + | |
339 | 343 |
| |
340 | 344 |
| |
341 | 345 |
| |
| |||
906 | 910 |
| |
907 | 911 |
| |
908 | 912 |
| |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
909 | 924 |
| |
910 | 925 |
| |
911 | 926 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
363 | 363 |
| |
364 | 364 |
| |
365 | 365 |
| |
366 |
| - | |
| 366 | + | |
367 | 367 |
| |
368 | 368 |
| |
369 | 369 |
| |
|
0 commit comments
Comments
(0)