diff options
author | Thomas Munro <tmunro@postgresql.org> | 2021-04-10 08:09:30 +1200 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2021-04-10 08:21:53 +1200 |
commit | dc88460c24ed71ba7464ef4749e5f25da1bf6652 (patch) | |
tree | e89f1df829b1537cb94e23ab4e9d601455155668 /src | |
parent | 49fb4e6b249029e75ccc6b490d76f15cd53d553b (diff) | |
download | postgresql-dc88460c24ed71ba7464ef4749e5f25da1bf6652.tar.gz postgresql-dc88460c24ed71ba7464ef4749e5f25da1bf6652.zip |
Doc: Review for "Optionally prefetch referenced data in recovery."
Typos, corrections and language improvements in the docs, and a few in
code comments too.
Reported-by: Justin Pryzby <pryzby@telsasoft.com>
Discussion: https://postgr.es/m/20210409033703.GP6592%40telsasoft.com
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/access/transam/xlogprefetch.c | 12 | ||||
-rw-r--r-- | src/backend/utils/misc/guc.c | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/backend/access/transam/xlogprefetch.c b/src/backend/access/transam/xlogprefetch.c index 28764326bcc..2178c9086e6 100644 --- a/src/backend/access/transam/xlogprefetch.c +++ b/src/backend/access/transam/xlogprefetch.c @@ -31,12 +31,14 @@ * stall; this is counted with "skip_fpw". * * The only way we currently have to know that an I/O initiated with - * PrefetchSharedBuffer() has that recovery will eventually call ReadBuffer(), - * and perform a synchronous read. Therefore, we track the number of + * PrefetchSharedBuffer() has completed is to wait for the corresponding call + * to XLogReadBufferInRedo() to return. Therefore, we track the number of * potentially in-flight I/Os by using a circular buffer of LSNs. When it's - * full, we have to wait for recovery to replay records so that the queue - * depth can be reduced, before we can do any more prefetching. Ideally, this - * keeps us the right distance ahead to respect maintenance_io_concurrency. + * full, we have to wait for recovery to replay enough records to remove some + * LSNs, and only then can we initiate more prefetching. Ideally, this keeps + * us just the right distance ahead to respect maintenance_io_concurrency, + * though in practice it errs on the side of being too conservative because + * many I/Os complete sooner than we know. * *------------------------------------------------------------------------- */ diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 46f1d6406f5..6dd889a7c0e 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -2774,7 +2774,7 @@ static struct config_int ConfigureNamesInt[] = { {"wal_decode_buffer_size", PGC_POSTMASTER, WAL_ARCHIVE_RECOVERY, gettext_noop("Maximum buffer size for reading ahead in the WAL during recovery."), - gettext_noop("This controls the maximum distance we can read ahead n the WAL to prefetch referenced blocks."), + gettext_noop("This controls the maximum distance we can read ahead in the WAL to prefetch referenced blocks."), GUC_UNIT_BYTE }, &wal_decode_buffer_size, |