- Notifications
You must be signed in to change notification settings - Fork5k
Commit55b454d
aio: Infrastructure for io_method=worker
This commit contains the basic, system-wide, infrastructure forio_method=worker. It does not yet actually execute IO, this commit justprovides the infrastructure for running IO workers, kept separate for easierreview.The number of IO workers can be adjusted with a PGC_SIGHUP GUC. Eventuallywe'd like to make the number of workers dynamically scale up/down based on thecurrent "IO load".To allow the number of IO workers to be increased without a restart, we needto reserve PGPROC entries for the workers unconditionally. This has beenjudged to be worth the cost. If it turns out to be problematic, we canintroduce a PGC_POSTMASTER GUC to control the maximum number.As io workers might be needed during shutdown, e.g. for AIO during theshutdown checkpoint, a new PMState phase is added. IO workers are shut downafter the shutdown checkpoint has been performed and walsender/archiver haveshut down, but before the checkpointer itself shuts down. See also87a6690.Updates PGSTAT_FILE_FORMAT_ID due to the addition of a new BackendType.Reviewed-by: Noah Misch <noah@leadboat.com>Co-authored-by: Thomas Munro <thomas.munro@gmail.com>Co-authored-by: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/uvrtrknj4kdytuboidbhwclo4gxhswwcpgadptsjvjqcluzmah%40brqs62irg4dtDiscussion:https://postgr.es/m/20210223100344.llw5an2aklengrmn@alap3.anarazel.deDiscussion:https://postgr.es/m/stj36ea6yyhoxtqkhpieia2z4krnam7qyetc57rfezgk4zgapf@gcnactj4z56m1 parent549ea06 commit55b454d
File tree
20 files changed
+342
-15
lines changed- doc/src/sgml
- src
- backend
- postmaster
- storage/aio
- tcop
- utils
- activity
- init
- misc
- include
- storage
- test/regress/expected
20 files changed
+342
-15
lines changedLines changed: 19 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2689 | 2689 |
| |
2690 | 2690 |
| |
2691 | 2691 |
| |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
2692 | 2711 |
| |
2693 | 2712 |
| |
2694 | 2713 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
| 51 | + | |
51 | 52 |
| |
52 | 53 |
| |
53 | 54 |
| |
| |||
197 | 198 |
| |
198 | 199 |
| |
199 | 200 |
| |
| 201 | + | |
200 | 202 |
| |
201 | 203 |
| |
202 | 204 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
101 | 101 |
| |
102 | 102 |
| |
103 | 103 |
| |
| 104 | + | |
104 | 105 |
| |
105 | 106 |
| |
106 | 107 |
| |
|
Lines changed: 162 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
108 | 108 |
| |
109 | 109 |
| |
110 | 110 |
| |
| 111 | + | |
111 | 112 |
| |
| 113 | + | |
112 | 114 |
| |
113 | 115 |
| |
| 116 | + | |
114 | 117 |
| |
115 | 118 |
| |
116 | 119 |
| |
| |||
340 | 343 |
| |
341 | 344 |
| |
342 | 345 |
| |
| 346 | + | |
343 | 347 |
| |
344 | 348 |
| |
345 | 349 |
| |
| |||
402 | 406 |
| |
403 | 407 |
| |
404 | 408 |
| |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
405 | 413 |
| |
406 | 414 |
| |
407 | 415 |
| |
| |||
436 | 444 |
| |
437 | 445 |
| |
438 | 446 |
| |
| 447 | + | |
| 448 | + | |
439 | 449 |
| |
440 | 450 |
| |
441 | 451 |
| |
| |||
1365 | 1375 |
| |
1366 | 1376 |
| |
1367 | 1377 |
| |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
1368 | 1383 |
| |
1369 | 1384 |
| |
1370 | 1385 |
| |
| |||
1377 | 1392 |
| |
1378 | 1393 |
| |
1379 | 1394 |
| |
1380 |
| - | |
1381 | 1395 |
| |
1382 | 1396 |
| |
1383 | 1397 |
| |
| |||
2502 | 2516 |
| |
2503 | 2517 |
| |
2504 | 2518 |
| |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
2505 | 2529 |
| |
2506 | 2530 |
| |
2507 | 2531 |
| |
| |||
2723 | 2747 |
| |
2724 | 2748 |
| |
2725 | 2749 |
| |
| 2750 | + | |
2726 | 2751 |
| |
2727 | 2752 |
| |
2728 | 2753 |
| |
| |||
2905 | 2930 |
| |
2906 | 2931 |
| |
2907 | 2932 |
| |
2908 |
| - | |
2909 |
| - | |
| 2933 | + | |
| 2934 | + | |
2910 | 2935 |
| |
2911 | 2936 |
| |
2912 | 2937 |
| |
2913 | 2938 |
| |
2914 | 2939 |
| |
| 2940 | + | |
2915 | 2941 |
| |
2916 | 2942 |
| |
2917 | 2943 |
| |
2918 |
| - | |
2919 |
| - | |
2920 |
| - | |
2921 |
| - | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
2922 | 2948 |
| |
2923 | 2949 |
| |
2924 | 2950 |
| |
| |||
2933 | 2959 |
| |
2934 | 2960 |
| |
2935 | 2961 |
| |
2936 |
| - | |
2937 |
| - | |
| 2962 | + | |
| 2963 | + | |
2938 | 2964 |
| |
2939 | 2965 |
| |
2940 | 2966 |
| |
2941 | 2967 |
| |
| 2968 | + | |
2942 | 2969 |
| |
2943 | 2970 |
| |
2944 | 2971 |
| |
| |||
3039 | 3066 |
| |
3040 | 3067 |
| |
3041 | 3068 |
| |
3042 |
| - | |
| 3069 | + | |
3043 | 3070 |
| |
3044 | 3071 |
| |
3045 | 3072 |
| |
3046 |
| - | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
3047 | 3088 |
| |
3048 | 3089 |
| |
3049 | 3090 |
| |
| |||
3171 | 3212 |
| |
3172 | 3213 |
| |
3173 | 3214 |
| |
| 3215 | + | |
| 3216 | + | |
| 3217 | + | |
| 3218 | + | |
| 3219 | + | |
3174 | 3220 |
| |
3175 | 3221 |
| |
3176 | 3222 |
| |
3177 |
| - | |
3178 | 3223 |
| |
3179 | 3224 |
| |
3180 | 3225 |
| |
| |||
3198 | 3243 |
| |
3199 | 3244 |
| |
3200 | 3245 |
| |
| 3246 | + | |
3201 | 3247 |
| |
3202 | 3248 |
| |
3203 | 3249 |
| |
| |||
3235 | 3281 |
| |
3236 | 3282 |
| |
3237 | 3283 |
| |
| 3284 | + | |
| 3285 | + | |
| 3286 | + | |
| 3287 | + | |
| 3288 | + | |
| 3289 | + | |
| 3290 | + | |
| 3291 | + | |
| 3292 | + | |
| 3293 | + | |
3238 | 3294 |
| |
3239 | 3295 |
| |
3240 | 3296 |
| |
| |||
4120 | 4176 |
| |
4121 | 4177 |
| |
4122 | 4178 |
| |
| 4179 | + | |
4123 | 4180 |
| |
4124 | 4181 |
| |
4125 | 4182 |
| |
| |||
4270 | 4327 |
| |
4271 | 4328 |
| |
4272 | 4329 |
| |
| 4330 | + | |
| 4331 | + | |
| 4332 | + | |
| 4333 | + | |
| 4334 | + | |
| 4335 | + | |
| 4336 | + | |
| 4337 | + | |
| 4338 | + | |
| 4339 | + | |
| 4340 | + | |
| 4341 | + | |
| 4342 | + | |
| 4343 | + | |
| 4344 | + | |
| 4345 | + | |
| 4346 | + | |
| 4347 | + | |
| 4348 | + | |
| 4349 | + | |
| 4350 | + | |
| 4351 | + | |
| 4352 | + | |
| 4353 | + | |
| 4354 | + | |
| 4355 | + | |
| 4356 | + | |
| 4357 | + | |
| 4358 | + | |
| 4359 | + | |
| 4360 | + | |
| 4361 | + | |
| 4362 | + | |
| 4363 | + | |
| 4364 | + | |
| 4365 | + | |
| 4366 | + | |
| 4367 | + | |
| 4368 | + | |
| 4369 | + | |
| 4370 | + | |
| 4371 | + | |
| 4372 | + | |
| 4373 | + | |
| 4374 | + | |
| 4375 | + | |
| 4376 | + | |
| 4377 | + | |
| 4378 | + | |
| 4379 | + | |
| 4380 | + | |
| 4381 | + | |
| 4382 | + | |
| 4383 | + | |
| 4384 | + | |
| 4385 | + | |
| 4386 | + | |
| 4387 | + | |
| 4388 | + | |
| 4389 | + | |
| 4390 | + | |
| 4391 | + | |
| 4392 | + | |
| 4393 | + | |
| 4394 | + | |
| 4395 | + | |
| 4396 | + | |
| 4397 | + | |
| 4398 | + | |
| 4399 | + | |
| 4400 | + | |
| 4401 | + | |
| 4402 | + | |
| 4403 | + | |
| 4404 | + | |
| 4405 | + | |
| 4406 | + | |
| 4407 | + | |
| 4408 | + | |
| 4409 | + | |
| 4410 | + | |
| 4411 | + | |
| 4412 | + | |
| 4413 | + | |
| 4414 | + | |
| 4415 | + | |
| 4416 | + | |
| 4417 | + | |
| 4418 | + | |
| 4419 | + | |
| 4420 | + | |
| 4421 | + | |
| 4422 | + | |
4273 | 4423 |
| |
4274 | 4424 |
| |
4275 | 4425 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
| 18 | + | |
18 | 19 |
| |
19 | 20 |
| |
20 | 21 |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| 10 | + | |
10 | 11 |
| |
11 | 12 |
|
0 commit comments
Comments
(0)