Skip to content

Commit 2b04dfc

Browse files
committed
Improve error reporting for unsupported effective_io_concurrency setting.
Give a specific error complaining about lack of posix_fadvise() when someone tries to set effective_io_concurrency > 0 on platforms without that. This probably isn't worth extensive back-patching, but I (tgl) felt cramming it into v11 was reasonable. James Robinson Discussion: https://postgr.es/m/153771876450.14994.560017943128223619@wrigleys.postgresql.org Discussion: https://postgr.es/m/A3942987-5BC7-4F05-B54D-2A0EC2914B33@jlr-photo.com
1 parent 61f14cc commit 2b04dfc

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/backend/utils/misc/guc.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2649,10 +2649,11 @@ static struct config_int ConfigureNamesInt[] =
26492649
},
26502650
&effective_io_concurrency,
26512651
#ifdef USE_PREFETCH
2652-
1, 0, MAX_IO_CONCURRENCY,
2652+
1,
26532653
#else
2654-
0, 0, 0,
2654+
0,
26552655
#endif
2656+
0, MAX_IO_CONCURRENCY,
26562657
check_effective_io_concurrency, assign_effective_io_concurrency, NULL
26572658
},
26582659

@@ -10709,6 +10710,11 @@ check_effective_io_concurrency(int *newval, void **extra, GucSource source)
1070910710
else
1071010711
return false;
1071110712
#else
10713+
if (*newval != 0)
10714+
{
10715+
GUC_check_errdetail("effective_io_concurrency must be set to 0 on platforms that lack posix_fadvise()");
10716+
return false;
10717+
}
1071210718
return true;
1071310719
#endif /* USE_PREFETCH */
1071410720
}

src/include/pg_config_manual.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@
136136
/*
137137
* USE_PREFETCH code should be compiled only if we have a way to implement
138138
* prefetching. (This is decoupled from USE_POSIX_FADVISE because there
139-
* might in future be support for alternative low-level prefetch APIs.)
139+
* might in future be support for alternative low-level prefetch APIs.
140+
* If you change this, you probably need to adjust the error message in
141+
* check_effective_io_concurrency.)
140142
*/
141143
#ifdef USE_POSIX_FADVISE
142144
#define USE_PREFETCH

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy