Re: pg_upgrade and rsync

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: pg_upgrade and rsync
Дата
Msg-id 20150123015447.GI3854@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: pg_upgrade and rsync  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: pg_upgrade and rsync  (David Steele <david@pgmasters.net>)
Re: pg_upgrade and rsync  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Re: pg_upgrade and rsync  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
* Bruce Momjian (bruce@momjian.us) wrote:
> On Fri, Jan 23, 2015 at 01:19:33AM +0100, Andres Freund wrote:
> > Or do you - as the text edited in your patch, but not the quote above -
> > mean to run pg_upgrade just on the primary and then rsync?
>
> No, I was going to run it on both, then rsync.

I'm pretty sure this is all a lot easier than you believe it to be.  If
you want to recreate what pg_upgrade does to a cluster then the simplest
thing to do is rsync before removing any of the hard links.  rsync will
simply recreate the same hard link tree that pg_upgrade created when it
ran, and update files which were actually changed (the catalog tables).

The problem, as mentioned elsewhere, is that you have to checksum all
the files because the timestamps will differ.  You can actually get
around that with rsync if you really want though- tell it to only look
at file sizes instead of size+time by passing in --size-only.  I have to
admit that for *my* taste, at least, that's getting pretty darn
optimistic.  It *should* work, but I'd definitely recommend testing it
about a billion times in various ways before trusting it or recommending
it to anyone else.  I expect you'd need --inplace also, for cases where
the sizes are different and rsync wants to modify the file on the
destination to match the one on the source.
Thanks,
    Stephen

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Petr Jelinek
Дата:
Сообщение: Re: tracking commit timestamps
Следующее
От: Petr Jelinek
Дата:
Сообщение: Re: Using 128-bit integers for sum, avg and statistics aggregates