Skip to content

Commit 2ea4b29

Browse files
committed
Fix typos and incorrect type in read_stream.c
max_ios should be int rather than int16, otherwise there's not much point in doing: max_ios = Min(max_ios, PG_INT16_MAX); Discussion: https://postgr.es/m/CAApHDvr9Un-XpDr_+AFdOGM38O2K8SpfoHimqZ838gguTGYBiQ@mail.gmail.com
1 parent 5cd72cc commit 2ea4b29

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/backend/storage/aio/read_stream.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
*
2727
* B) I/O is necessary, but fadvise is undesirable because the access is
2828
* sequential, or impossible because direct I/O is enabled or the system
29-
* doesn't support advice. There is no benefit in looking ahead more than
30-
* io_combine_limit, because in this case only goal is larger read system
29+
* doesn't support fadvise. There is no benefit in looking ahead more than
30+
* io_combine_limit, because in this case the only goal is larger read system
3131
* calls. Looking further ahead would pin many buffers and perform
3232
* speculative work looking ahead for no benefit.
3333
*
34-
* C) I/O is necesssary, it appears random, and this system supports fadvise.
34+
* C) I/O is necessary, it appears random, and this system supports fadvise.
3535
* We'll look further ahead in order to reach the configured level of I/O
3636
* concurrency.
3737
*
@@ -418,7 +418,7 @@ read_stream_begin_relation(int flags,
418418
ReadStream *stream;
419419
size_t size;
420420
int16 queue_size;
421-
int16 max_ios;
421+
int max_ios;
422422
int strategy_pin_limit;
423423
uint32 max_pinned_buffers;
424424
Oid tablespace_id;
@@ -447,6 +447,8 @@ read_stream_begin_relation(int flags,
447447
max_ios = get_tablespace_maintenance_io_concurrency(tablespace_id);
448448
else
449449
max_ios = get_tablespace_io_concurrency(tablespace_id);
450+
451+
/* Cap to INT16_MAX to avoid overflowing below */
450452
max_ios = Min(max_ios, PG_INT16_MAX);
451453

452454
/*

0 commit comments

Comments
 (0)