Re: pg_upgrade parallelism

From: Jacob Champion <pchampion(at)vmware(dot)com>
To: "pryzby(at)telsasoft(dot)com" <pryzby(at)telsasoft(dot)com>, "jcasanov(at)systemguards(dot)com(dot)ec" <jcasanov(at)systemguards(dot)com(dot)ec>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade parallelism
Date: 2021-11-23 18:54:03
Message-ID: d349112944f2d19e9ad884ca805a3f9561a7c853.camel@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2021-11-17 at 14:34 -0600, Justin Pryzby wrote:
> On Wed, Nov 17, 2021 at 02:44:52PM -0500, Jaime Casanova wrote:
> >
> > - why we read()/write() at all? is not a faster way of copying the file?
> > i'm asking that because i don't actually know.
>
> No portable way. Linux has this:
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fman7.org%2Flinux%2Fman-pages%2Fman2%2Fcopy_file_range.2.html&amp;data=04%7C01%7Cpchampion%40vmware.com%7C35fb5d59bd2745636fd408d9aa09a245%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637727780625465398%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=PS6OCE55n12KBOjh5qZ2uGzDR9U687nzNIV5AM9Zke4%3D&amp;reserved=0
>
> But I just read:
>
> > First support for cross-filesystem copies was introduced in Linux
> > 5.3. Older kernels will return -EXDEV when cross-filesystem
> > copies are attempted.
>
> To me that sounds like it may not be worth it, at least not quite yet.
> But it would be good to test.

I think a downside of copy_file_range() is that filesystems might
perform a reflink under us, and to me that seems like something that
needs to be opted into via clone mode.

(https://lwn.net/Articles/846403/ is also good reading on some sharp
edges, though I doubt many of them apply to our use case.)

--Jacob

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-11-23 19:04:19 Re: prevent immature WAL streaming
Previous Message Robert Haas 2021-11-23 18:36:56 Re: xlog.c: removing ReadRecPtr and EndRecPtr