Re: pg_upgrade --copy-file-range fails with EINVAL on Linux 4.19

From: 达劳里亚斯 <ihaveabigdoor(at)gmail(dot)com>
To: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pg_upgrade --copy-file-range fails with EINVAL on Linux 4.19
Date: 2026-08-22 10:21:27
Message-ID: CAJh1Vjayeb_+QcHBQQLZDzPdpYXjtfx1=MLJQsR-_cp6u69FPg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Jakub,

Thanks, option (4) makes sense to me. I'll prepare a patch to disable
HAVE_COPY_FILE_RANGE when building against Linux kernel headers older
than 5.3, covering both the Autoconf and Meson build paths.

Thanks,
Johnny

Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com> 于2026年8月21日周五 19:01写道:
>
> Hi Johnny,
>
> On Fri, Aug 21, 2026 at 8:19 AM 达劳里亚斯 <ihaveabigdoor(at)gmail(dot)com> wrote:
> >
> [..]
> > On 4.19 a non-empty source makes round 1 return > 0, so round 2 always
> > runs, always returns EINVAL, and we pg_fatal.
> > An empty file would return 0 on round 1 and skip round 2; relation
> > files are not empty.
>
> As per [1], the 4.19 (LTS series) was released in 2018 and went EOS on 2024
> and running that today anywhere on production would be not responsilbe
> anyway, so option 4: why just not add override #undef HAVE_FILE_COPY_RANGE
> when kernel is < 5.3 then? (in configure.ac and meson.build). Dunno what else
> may misbehave there as nobody is going to test it combitation with that old
> fs code too, but at least the tests won't complain. We use that syscall in
> other tools too...
>
> -J.
>
> [1] - https://endoflife.date/linux

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2026-08-22 10:26:15 Re: Further cleanup related to statistics import support in postgres_fdw
Previous Message Amit Langote 2026-08-22 07:43:18 Re: PG19 FK fast path: OOB write and missed FK checks during batched