mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
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
This commit is contained in:
parent
61f14cc8c8
commit
2b04dfc472
@ -2649,10 +2649,11 @@ static struct config_int ConfigureNamesInt[] =
|
|||||||
},
|
},
|
||||||
&effective_io_concurrency,
|
&effective_io_concurrency,
|
||||||
#ifdef USE_PREFETCH
|
#ifdef USE_PREFETCH
|
||||||
1, 0, MAX_IO_CONCURRENCY,
|
1,
|
||||||
#else
|
#else
|
||||||
0, 0, 0,
|
0,
|
||||||
#endif
|
#endif
|
||||||
|
0, MAX_IO_CONCURRENCY,
|
||||||
check_effective_io_concurrency, assign_effective_io_concurrency, NULL
|
check_effective_io_concurrency, assign_effective_io_concurrency, NULL
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -10709,6 +10710,11 @@ check_effective_io_concurrency(int *newval, void **extra, GucSource source)
|
|||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
#else
|
#else
|
||||||
|
if (*newval != 0)
|
||||||
|
{
|
||||||
|
GUC_check_errdetail("effective_io_concurrency must be set to 0 on platforms that lack posix_fadvise()");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
#endif /* USE_PREFETCH */
|
#endif /* USE_PREFETCH */
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,9 @@
|
|||||||
/*
|
/*
|
||||||
* USE_PREFETCH code should be compiled only if we have a way to implement
|
* USE_PREFETCH code should be compiled only if we have a way to implement
|
||||||
* prefetching. (This is decoupled from USE_POSIX_FADVISE because there
|
* prefetching. (This is decoupled from USE_POSIX_FADVISE because there
|
||||||
* might in future be support for alternative low-level prefetch APIs.)
|
* might in future be support for alternative low-level prefetch APIs.
|
||||||
|
* If you change this, you probably need to adjust the error message in
|
||||||
|
* check_effective_io_concurrency.)
|
||||||
*/
|
*/
|
||||||
#ifdef USE_POSIX_FADVISE
|
#ifdef USE_POSIX_FADVISE
|
||||||
#define USE_PREFETCH
|
#define USE_PREFETCH
|
||||||
|
Loading…
x
Reference in New Issue
Block a user