Re: pg_upgrade + replica servers + rsync --size-only is unsafe

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: pg_upgrade + replica servers + rsync --size-only is unsafe
Дата
Msg-id CAOuzzgqd=zsOvaiCu_agYES-BCZANAQYLghh7MfJQ7yNF8Xu2Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_upgrade + replica servers + rsync --size-only is unsafe  (Rob Emery <re-pgsql@codeweavers.net>)
Ответы Re: pg_upgrade + replica servers + rsync --size-only is unsafe
Re: pg_upgrade + replica servers + rsync --size-only is unsafe
Список pgsql-admin
Greetings,

Please don’t top post on these lists. Thanks. 

On Thu, Dec 3, 2020 at 06:42 Rob Emery <re-pgsql@codeweavers.net> wrote:
Hello Stephen,

>Then you run the rsync, at the /srv level, and all those 'new files' in
>/srv/new_cluster on the primary should get copied over to
>/srv/new_cluster on the replica, while any files which are hard-linked
>between old_cluster and new_cluster should end up as hard links on the
>replica.
>
>Thanks,

Thanks very much for your reply.  

We've re-ran our test upgrade this morning just to be certain and we reproduced the same result once again, it appears that the issue is not that the pg_controlfile is hardlinked, but that it exists at all.

The output of pg_controldata shows a different ID on the master and the secondary as you suspected:

Master:

$ ./pg_controldata /var/lib/postgresql/9.6/main
pg_control version number:            960
Catalog version number:               201608131
Database system identifier:           6901965895850147745
Database cluster state:               in production
pg_control last modified:             Thu 03 Dec 2020 10:11:21 GMT

Secondary:

$ ./pg_controldata /var/lib/postgresql/9.6/main
pg_control version number:            960
Catalog version number:               201608131
Database system identifier:           6901966223447496344
Database cluster state:               shut down
pg_control last modified:             Thu 03 Dec 2020 09:54:00 GMT

The pg_control file does exist on the secondary 9.6 prior to the rsync because it is created by the initdb command (which is step 4. of the instructions - https://www.postgresql.org/docs/9.6/pgupgrade.html; we verified that by running `/usr/lib/postgresql/9.6/bin/initdb /var/lib/postgresql/999/main` and it creates a pg_control file).

The initdb is run only on the primary. Note that 10.b specifically says:

  1. Make sure the new standby data directories do not exist

    Make sure the new standby data directories do not exist or are empty. If initdb was run, delete the standby servers' new data directories. 


Try your test again *without* running initdb on the replica. 

Thanks,

Stephen

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

Предыдущее
От: Rob Emery
Дата:
Сообщение: Re: pg_upgrade + replica servers + rsync --size-only is unsafe
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: pg_upgrade + replica servers + rsync --size-only is unsafe