Skip to content

Commit f132815

Browse files
Add maintenance_io_concurrency flag to some read stream users
Index vacuuming and [auto]prewarm AIO concurrency should be governed by maintenance_io_concurrency. As such, pass those read stream users the READ_STREAM_MAINTENANCE flag which will calculate their read stream distance with maintenance_io_concurrency instead of effective_io_concurrency. This was an oversight in the original commits making those operations use the read stream API. Discussion: https://postgr.es/m/flat/CAAKRu_aopDxTo4b41Mt_7Zc-z0_ngocrY8SFCCY6Aph1HgwuNw%40mail.gmail.com
1 parent ce72e7e commit f132815

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

contrib/pg_prewarm/autoprewarm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,8 @@ autoprewarm_database_main(Datum main_arg)
621621
.nblocks = nblocks,
622622
};
623623

624-
stream = read_stream_begin_relation(READ_STREAM_DEFAULT |
624+
stream = read_stream_begin_relation(READ_STREAM_MAINTENANCE |
625+
READ_STREAM_DEFAULT |
625626
READ_STREAM_USE_BATCHING,
626627
NULL,
627628
rel,

contrib/pg_prewarm/pg_prewarm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ pg_prewarm(PG_FUNCTION_ARGS)
202202
* It is safe to use batchmode as block_range_read_stream_cb takes no
203203
* locks.
204204
*/
205-
stream = read_stream_begin_relation(READ_STREAM_FULL |
205+
stream = read_stream_begin_relation(READ_STREAM_MAINTENANCE |
206+
READ_STREAM_FULL |
206207
READ_STREAM_USE_BATCHING,
207208
NULL,
208209
rel,

src/backend/access/gist/gistvacuum.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ gistvacuumscan(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
215215
* It is safe to use batchmode as block_range_read_stream_cb takes no
216216
* locks.
217217
*/
218-
stream = read_stream_begin_relation(READ_STREAM_FULL |
218+
stream = read_stream_begin_relation(READ_STREAM_MAINTENANCE |
219+
READ_STREAM_FULL |
219220
READ_STREAM_USE_BATCHING,
220221
info->strategy,
221222
rel,

src/backend/access/nbtree/nbtree.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,8 @@ btvacuumscan(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
12321232
* It is safe to use batchmode as block_range_read_stream_cb takes no
12331233
* locks.
12341234
*/
1235-
stream = read_stream_begin_relation(READ_STREAM_FULL |
1235+
stream = read_stream_begin_relation(READ_STREAM_MAINTENANCE |
1236+
READ_STREAM_FULL |
12361237
READ_STREAM_USE_BATCHING,
12371238
info->strategy,
12381239
rel,

src/backend/access/spgist/spgvacuum.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,8 @@ spgvacuumscan(spgBulkDeleteState *bds)
827827
* It is safe to use batchmode as block_range_read_stream_cb takes no
828828
* locks.
829829
*/
830-
stream = read_stream_begin_relation(READ_STREAM_FULL |
830+
stream = read_stream_begin_relation(READ_STREAM_MAINTENANCE |
831+
READ_STREAM_FULL |
831832
READ_STREAM_USE_BATCHING,
832833
bds->info->strategy,
833834
index,

0 commit comments

Comments
 (0)