diff options
author | David Rowley <drowley@postgresql.org> | 2024-05-01 17:04:52 +1200 |
---|---|---|
committer | David Rowley <drowley@postgresql.org> | 2024-05-01 17:04:52 +1200 |
commit | 2ea4b29277222efe59dc25ed8385c8bcb1a3ed0f (patch) | |
tree | 471e55f0d60f32be172842802f1608f236ef1451 /src | |
parent | 5cd72cc0c5017a9d4de8b5d465a75946da5abd1d (diff) | |
download | postgresql-2ea4b29277222efe59dc25ed8385c8bcb1a3ed0f.tar.gz postgresql-2ea4b29277222efe59dc25ed8385c8bcb1a3ed0f.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/storage/aio/read_stream.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/storage/aio/read_stream.c b/src/backend/storage/aio/read_stream.c index 634cf4f0d10..74b9bae6313 100644 --- a/src/backend/storage/aio/read_stream.c +++ b/src/backend/storage/aio/read_stream.c @@ -26,12 +26,12 @@ * * B) I/O is necessary, but fadvise is undesirable because the access is * sequential, or impossible because direct I/O is enabled or the system - * doesn't support advice. There is no benefit in looking ahead more than - * io_combine_limit, because in this case only goal is larger read system + * doesn't support fadvise. There is no benefit in looking ahead more than + * io_combine_limit, because in this case the only goal is larger read system * calls. Looking further ahead would pin many buffers and perform * speculative work looking ahead for no benefit. * - * C) I/O is necesssary, it appears random, and this system supports fadvise. + * C) I/O is necessary, it appears random, and this system supports fadvise. * We'll look further ahead in order to reach the configured level of I/O * concurrency. * @@ -418,7 +418,7 @@ read_stream_begin_relation(int flags, ReadStream *stream; size_t size; int16 queue_size; - int16 max_ios; + int max_ios; int strategy_pin_limit; uint32 max_pinned_buffers; Oid tablespace_id; @@ -447,6 +447,8 @@ read_stream_begin_relation(int flags, max_ios = get_tablespace_maintenance_io_concurrency(tablespace_id); else max_ios = get_tablespace_io_concurrency(tablespace_id); + + /* Cap to INT16_MAX to avoid overflowing below */ max_ios = Min(max_ios, PG_INT16_MAX); /* |