Re: [PATCH] pg_upgrade: support for btrfs copy-on-write clones

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Oskari Saarenmaa <os(at)ohmu(dot)fi>, Larry Rosenman <ler(at)lerctr(dot)org>, Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] pg_upgrade: support for btrfs copy-on-write clones
Date: 2014-02-13 03:07:31
Message-ID: 20140213030731.GE4831@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 15, 2013 at 10:40:20AM +0200, Heikki Linnakangas wrote:
> >The BTRFS_IOC_CLONE ioctl operates on file level and can be used to
> >clone files anywhere in a btrfs filesystem.
>
> Hmm, you can also do
>
> cp --reflog -r data92 data-tmp

I think you mean --reflink here.

> pg_upgrade --link --old-datadir=data92-copy --new-datadir=data-tmp
> rm -rf data-tmp
>
> That BTRFS_IOC_CLONE ioctl seems so hacky that I'd rather not get
> that in our source tree. cp --reflog is much more likely to get that
> magic incantation right, since it gets a lot more attention and
> testing than pg_upgrade.
>
> I'm not in favor of adding filesystem-specific tricks into
> pg_upgrade. It would be nice to list these tricks in the docs,
> though.

I have applied the attached patch which suggests the use of file system
snapshots and copy-on-write file copies.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

Attachment Content-Type Size
pg_upgrade.diff text/x-diff 1.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2014-02-13 03:10:58 Re: Prevent pg_basebackup -Fp -D -?
Previous Message Greg Stark 2014-02-13 03:05:14 Re: Recovery inconsistencies, standby much larger than primary