On 11/20/26 01:14, Fujii Masao wrote:
> On Fri, Nov 20, 2026 at 8:22 AM Tomas Vondra <[email protected]> wrote:
>> What's a good way to check if a machine supports posix_fadvise? I don't
>> see any TAP test already doing that. I guess we could try assigning into
>> effective_io_concurrency, and skip the test if it fails.
>
> In v18 and later, setting effective_io_concurrency would succeed even on
> the platform not supporting posix_fadvise(), such as Windows?
> If so, checking recovery_prefetch = on might be a better approach?
> Because its check hook, check_recovery_prefetch(), seems to always
> return false when USE_PREFETCH is not enabled.
>
Actually, there's an easier way. We already have check_pg_config(), so
we can do just this:
# Prefetching requires posix_fadvise(). Without it, the server rejects the
# non-zero maintenance_io_concurrency this test relies on.
if (!check_pg_config("#define HAVE_POSIX_FADVISE 1"))
{
plan skip_all => 'posix_fadvise() not supported by this platform';
}
Will push the fix in the morning.
--
Tomas Vondra