Re: pg_upgrade and rsync

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: pg_upgrade and rsync
Дата
Msg-id 20150123191709.GR11664@awork2.anarazel.de
обсуждение исходный текст
Ответ на Re: pg_upgrade and rsync  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: pg_upgrade and rsync  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-hackers
On 2015-01-23 14:05:10 -0500, Stephen Frost wrote:
> * Andres Freund (andres@2ndquadrant.com) wrote:
> > On 2015-01-23 13:52:54 -0500, Stephen Frost wrote:
> > > That wouldn't actually help with what Bruce is trying to do, which
> > > is to duplicate the results of the pg_upgrade from the master over to
> > > the standby.
> > 
> > Well, it'd pretty much obliviate the need to run pg_upgrade on the
> > standby. As there's no renamed files you don't need to muck around with
> > leaving hardlinks in place and such just so that rsync recognizes
> > unchanged files.
> 
> Uh, pg_upgrade always either creates a hard link tree or copies
> everything over.

Yes. The problem is that the filenames after pg_upgrade aren't the same
as before. Which means that a simple rsync call won't be able to save
anything because the standby's filenames differ.  What you can do is
rsync both cluster directories (i.e. the old and the post pg_upgrade
ones) and use rsync -H, right? Without transferring both -H won't detect
the hardlinks as they need to be in the synced set. That's pretty
cumbersome/complicated, and far from cheap.

> If I follow what you're suggesting, pg_upgrade would
> need a new 'in-place' mode that removes all of the catalog tables from
> the old cluster and puts the new catalog tables into place and leaves
> everything else alone.

No. Except that it'd preserve the relfilenodes (i.e. the filenames of
relations) it'd work exactly the same as today. The standby is simply
updated by rsyncing the new data directory of the primary to the
standby.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



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

Предыдущее
От: andres@anarazel.de (Andres Freund)
Дата:
Сообщение: Re: basebackups during ALTER DATABASE ... SET TABLESPACE ... not safe?
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: hung backends stuck in spinlock heavy endless loop