Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2b04dfc

Browse files
committed
Improve error reporting for unsupported effective_io_concurrency setting.
Give a specific error complaining about lack of posix_fadvise() whensomeone tries to set effective_io_concurrency > 0 on platformswithout that.This probably isn't worth extensive back-patching, but I (tgl) feltcramming it into v11 was reasonable.James RobinsonDiscussion:https://postgr.es/m/153771876450.14994.560017943128223619@wrigleys.postgresql.orgDiscussion:https://postgr.es/m/A3942987-5BC7-4F05-B54D-2A0EC2914B33@jlr-photo.com
1 parent61f14cc commit2b04dfc

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
#ifdefUSE_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
#ifdefUSE_POSIX_FADVISE
142144
#defineUSE_PREFETCH

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp