Re: pg_upgrade and rsync

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: pg_upgrade and rsync
Дата
Msg-id 20150123012335.GD15865@momjian.us
обсуждение исходный текст
Ответ на Re: pg_upgrade and rsync  (Andres Freund <andres@2ndquadrant.com>)
Ответы Re: pg_upgrade and rsync  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-hackers
On Fri, Jan 23, 2015 at 01:19:33AM +0100, Andres Freund wrote:
> On 2015-01-22 14:20:51 -0500, Bruce Momjian wrote:
> > It is possible to upgrade on pg_upgrade on streaming standby servers by
> > making them master servers, running pg_upgrade on them, then shuting
> > down all servers and using rsync to make the standby servers match the
> > real master.
> 
> Isn't that a pretty crazy procedure? If you need to shut down all

Yes, it is crazy, but so is pg_upgrade.  ;-)

> servers anyway, you can just rsync after having run pg_upgrade on the
> master, no? Rsync won't really transfer less just because you ran a
> similar thing on the standby.

Uh, yeah, it will, because the files can get renamed as part of the
upgrade (relfilenode now matches oid), so by running the upgrade, file
names are going to match up.  I didn't think rsync could handle renaming
of files without recopying the entire file.

> Even if this would allow to avoid some traffic for fsync: There's
> absolutely no guarantee that the standby's pg_upgrade results in a all
> that similar data directory. Far from everything in postgres is
> deterministic - it's easy to hit timing differences that result in
> noticeable differences.

Right, some non-deterministic things would change, but I thought
runnning upgrade on the standby would help.  However, now that I think
of it, we don't preserver the database directory name and assume
dbs will will get the same oid and therefore same database directory
name on both, but if you use -j, things are going to happen in random
order.  Oops.

Oh well.

> 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 am thinking the fix for standys would be similar to what we recommand
for upgrades with link mode using a rsync-created copy, e.g. use rsync
while the master is running to create a copy of the standby, then shut
down the master and run rsync again.  However, at that point, you might
as well just take a base backup and be done with it.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + Everyone has their own god. +



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Minor issues with code comments related to abbreviated keys
Следующее
От: Petr Jelinek
Дата:
Сообщение: Re: tracking commit timestamps