Re: copy_file_range is now a Linux kernel call

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: copy_file_range is now a Linux kernel call
Date: 2018-01-03 03:51:03
Message-ID: 20180103035103.2emyakbbdflh7xsk@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2018-01-02 22:44:04 -0500, Tom Lane wrote:
> Buildfarm member caiman just came back online after some time AWOL, and
> it's not happy. The problem evidently is that pg_rewind's copy_file_range
> function conflicts with a recently added Linux system call:
>
> http://man7.org/linux/man-pages/man2/copy_file_range.2.html
>
Heh, just observed the same:
http://archives.postgresql.org/message-id/20180103033425.w7jkljth3e26sduc%40alap3.anarazel.de

> Looks like we'd better rename our function. Anybody have an idea
> more creative than "pg_copy_file_range"?

I'd rather name it pg_rewind specific, something like
rwnd_copy_file_range or such. It's not a generic range copying facility,
given the way it computes source/target file names.

> (At some point somebody might want to think about fixing this function
> so it can make use of the kernel call when available. But that's more
> work than I care to do right now, and certainly more change than I'd want
> to back-patch.)

If so we'd probably want to do so in a more generic facility than what
pg_rewind uses. But for now it indeed seems like a bad idea to do
so. Besides the backpatch concern you mention, the functionality is also
just present in an unreleased glibc version...

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-01-03 03:54:29 Re: [HACKERS] GnuTLS support
Previous Message Tom Lane 2018-01-03 03:44:04 copy_file_range is now a Linux kernel call