- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit500b617
committed
Fix bug allowing io_combine_limit > io_max_combine_combine limit
10f6646 intended to limit the value of io_combine_limit to the minimum ofio_combine_limit and io_max_combine_limit. To avoid issues with interdependentGUCs, it introduced io_combine_limit_guc and set io_combine_limit in assignhooks. That plan was thwarted by guc_tables.c accidentally still referencingio_combine_limit, instead of io_combine_limit_guc. That lead to the GUCmachinery overriding the work done in the assign hooks, potentially leavingio_combine_limit with a too high value.The consequence of this bug was that when running with io_combine_limit >io_combine_limit_guc the AIO machinery would not have reserved large enoughiovec and IO data arrays, with one IO's arrays overlapping with another IO's,leading to total confusion.To make such a problem easier to detect in the future, add assertions topgaio_io_set_handle_data_* checking the length is smaller thanio_max_combine_limit (not just PG_IOV_MAX).It'd be nice to have a few tests for this, but it's not entirely obvious howto do so portably.As remarked upon by Tom, the GUC assignment hooks really shouldn't set theunderlying variable, that's the job of the GUC machinery. Change that as well.Discussion:https://postgr.es/m/c5jyqnuwrpigd35qe7xdypxsisdjrdba5iw63mhcse4mzjogxo@qdjpv22z763f1 parent0d9114b commit500b617
File tree
3 files changed
+5
-5
lines changed- src/backend
- commands
- storage/aio
- utils/misc
3 files changed
+5
-5
lines changedLines changed: 2 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1163 | 1163 |
| |
1164 | 1164 |
| |
1165 | 1165 |
| |
1166 |
| - | |
1167 |
| - | |
| 1166 | + | |
1168 | 1167 |
| |
1169 | 1168 |
| |
1170 | 1169 |
| |
1171 | 1170 |
| |
1172 |
| - | |
1173 |
| - | |
| 1171 | + | |
1174 | 1172 |
| |
1175 | 1173 |
| |
1176 | 1174 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
124 | 124 |
| |
125 | 125 |
| |
126 | 126 |
| |
| 127 | + | |
127 | 128 |
| |
128 | 129 |
| |
129 | 130 |
| |
| |||
141 | 142 |
| |
142 | 143 |
| |
143 | 144 |
| |
| 145 | + | |
144 | 146 |
| |
145 | 147 |
| |
146 | 148 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3287 | 3287 |
| |
3288 | 3288 |
| |
3289 | 3289 |
| |
3290 |
| - | |
| 3290 | + | |
3291 | 3291 |
| |
3292 | 3292 |
| |
3293 | 3293 |
| |
|
0 commit comments
Comments
(0)