From c2dc19342e05e081dc13b296787baa38352681ef Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Mon, 10 May 2021 16:00:53 +1200 Subject: Revert recovery prefetching feature. This set of commits has some bugs with known fixes, but at this late stage in the release cycle it seems best to revert and resubmit next time, along with some new automated test coverage for this whole area. Commits reverted: dc88460c: Doc: Review for "Optionally prefetch referenced data in recovery." 1d257577: Optionally prefetch referenced data in recovery. f003d9f8: Add circular WAL decoding buffer. 323cbe7c: Remove read_page callback from XLogReader. Remove the new GUC group WAL_RECOVERY recently added by a55a9847, as the corresponding section of config.sgml is now reverted. Discussion: https://postgr.es/m/CAOuzzgrn7iKnFRsB4MHp3UisEQAGgZMbk_ViTN4HV4-Ksq8zCg%40mail.gmail.com --- doc/src/sgml/config.sgml | 83 ------------------------------------------ doc/src/sgml/monitoring.sgml | 86 ++------------------------------------------ doc/src/sgml/wal.sgml | 15 -------- 3 files changed, 2 insertions(+), 182 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index f129a875014..45bd1f1b7e3 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -3588,89 +3588,6 @@ include_dir 'conf.d' - - - Recovery - - - configuration - of recovery - general settings - - - - This section describes the settings that apply to recovery in general, - affecting crash recovery, streaming replication and archive-based - replication. - - - - - - recovery_prefetch (boolean) - - recovery_prefetch configuration parameter - - - - - Whether to try to prefetch blocks that are referenced in the WAL that - are not yet in the buffer pool, during recovery. Prefetching blocks - that will soon be needed can reduce I/O wait times in some workloads. - See also the and - settings, which limit - prefetching activity. - This setting is disabled by default. - - - This feature currently depends on an effective - posix_fadvise function, which some - operating systems lack. - - - - - - recovery_prefetch_fpw (boolean) - - recovery_prefetch_fpw configuration parameter - - - - - Whether to prefetch blocks that were logged with full page images, - during recovery. Often this doesn't help, since such blocks will not - be read the first time they are needed and might remain in the buffer - pool after that. However, on file systems with a block size larger - than - PostgreSQL's, prefetching can avoid a - costly read-before-write when blocks are later written. - The default is off. - - - - - - wal_decode_buffer_size (integer) - - wal_decode_buffer_size configuration parameter - - - - - A limit on how far ahead the server can look in the WAL, to find - blocks to prefetch. Setting it too high might be counterproductive, - if it means that data falls out of the - kernel cache before it is needed. If this value is specified without - units, it is taken as bytes. - The default is 512kB. - - - - - - - Archive Recovery diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 370cdc2e1a1..dcbb10fb6ff 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -337,13 +337,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser - - pg_stat_prefetch_recoverypg_stat_prefetch_recovery - Only one row, showing statistics about blocks prefetched during recovery. - See for details. - - - pg_stat_subscriptionpg_stat_subscription At least one row per subscription, showing information about @@ -2948,78 +2941,6 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i copy of the subscribed tables. - - <structname>pg_stat_prefetch_recovery</structname> View - - - - Column - Type - Description - - - - - - prefetch - bigint - Number of blocks prefetched because they were not in the buffer pool - - - skip_hit - bigint - Number of blocks not prefetched because they were already in the buffer pool - - - skip_new - bigint - Number of blocks not prefetched because they were new (usually relation extension) - - - skip_fpw - bigint - Number of blocks not prefetched because a full page image was included in the WAL and was set to off - - - skip_seq - bigint - Number of blocks not prefetched because of repeated access - - - distance - integer - How far ahead of recovery the prefetcher is currently reading, in bytes - - - queue_depth - integer - How many prefetches have been initiated but are not yet known to have completed - - - avg_distance - float4 - How far ahead of recovery the prefetcher is on average, while recovery is not idle - - - avg_queue_depth - float4 - Average number of prefetches in flight while recovery is not idle - - - -
- - - The pg_stat_prefetch_recovery view will contain only - one row. It is filled with nulls if recovery is not running or WAL - prefetching is not enabled. See - for more information. The counters in this view are reset whenever the - , - or - setting is changed and - the server configuration is reloaded. - - <structname>pg_stat_subscription</structname> View @@ -5152,11 +5073,8 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i all the counters shown in the pg_stat_bgwriter view, archiver to reset all the counters shown in - the pg_stat_archiver view, - wal to reset all the counters shown in the - pg_stat_wal view or - prefetch_recovery to reset all the counters shown - in the pg_stat_prefetch_recovery view. + the pg_stat_archiver view or wal + to reset all the counters shown in the pg_stat_wal view. This function is restricted to superusers by default, but other users diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml index 9606c617d41..60f066d2473 100644 --- a/doc/src/sgml/wal.sgml +++ b/doc/src/sgml/wal.sgml @@ -803,21 +803,6 @@ counted as wal_write and wal_sync in pg_stat_wal, respectively. - - - The parameter can - be used to improve I/O performance during recovery by instructing - PostgreSQL to initiate reads - of disk blocks that will soon be needed but are not currently in - PostgreSQL's buffer pool. - The and - settings limit prefetching - concurrency and distance, respectively. The - prefetching mechanism is most likely to be effective on systems - with full_page_writes set to - off (where that is safe), and where the working - set is larger than RAM. By default, prefetching in recovery is disabled. - -- cgit v1.2.3