Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a8fb03f

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 6c8671b commit a8fb03f

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
@@ -2641,10 +2641,11 @@ static struct config_int ConfigureNamesInt[] =
26412641
},
26422642
&effective_io_concurrency,
26432643
#ifdef USE_PREFETCH
2644-
1, 0, MAX_IO_CONCURRENCY,
2644+
1,
26452645
#else
2646-
0, 0, 0,
2646+
0,
26472647
#endif
2648+
0, MAX_IO_CONCURRENCY,
26482649
check_effective_io_concurrency, assign_effective_io_concurrency, NULL
26492650
},
26502651

@@ -10681,6 +10682,11 @@ check_effective_io_concurrency(int *newval, void **extra, GucSource source)
1068110682
else
1068210683
return false;
1068310684
#else
10685+
if (*newval != 0)
10686+
{
10687+
GUC_check_errdetail("effective_io_concurrency must be set to 0 on platforms that lack posix_fadvise()");
10688+
return false;
10689+
}
1068410690
return true;
1068510691
#endif /* USE_PREFETCH */
1068610692
}

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)