Обсуждение: upgrade to PG11 on secondary fails (no initdb was launched)

Поиск
Список
Период
Сортировка

upgrade to PG11 on secondary fails (no initdb was launched)

От
Mariel Cherkassky
Дата:
Hey,
I have 2 nodes that are configured with streaming replication (PG 9.6, repmgr 4.3).
I was trying to upgrade the nodes to PG11 with the doc - https://www.postgresql.org/docs/11/pgupgrade.html
Everything goes well until I try to start the secondary and then it fails on the next error : 

2019-05-23 04:17:02 EDT  23593  FATAL:  database files are incompatible with server
2019-05-23 04:17:02 EDT  23593  DETAIL:  The database cluster was initialized with PG_CONTROL_VERSION 960, but the server was compiled with PG_CONTROL_VERSION 1100.
2019-05-23 04:17:02 EDT  23593  HINT:  It looks like you need to initdb.
2019-05-23 04:17:02 EDT  23593  LOG:  database system is shut down

I upgraded the primary, then I run the rsync command in the primary : 
rsync --archive --delete --hard-links --size-only --no-inc-recursive /var/lib/pgsql/data /var/lib/pgsql/11/data/ secondary_ip:/var/lib/pgsql/data/

in the secondary I checked the version file and it was 11 : 
[secondary]# cat PG_VERSION
11

Any idea how to handle it ?

Fwd: upgrade to PG11 on secondary fails (no initdb was launched)

От
Mariel Cherkassky
Дата:

Hey,
I have 2 nodes that are configured with streaming replication (PG 9.6, repmgr 4.3).
I was trying to upgrade the nodes to PG11 with the doc - https://www.postgresql.org/docs/11/pgupgrade.html
Everything goes well until I try to start the secondary and then it fails on the next error : 

2019-05-23 04:17:02 EDT  23593  FATAL:  database files are incompatible with server
2019-05-23 04:17:02 EDT  23593  DETAIL:  The database cluster was initialized with PG_CONTROL_VERSION 960, but the server was compiled with PG_CONTROL_VERSION 1100.
2019-05-23 04:17:02 EDT  23593  HINT:  It looks like you need to initdb.
2019-05-23 04:17:02 EDT  23593  LOG:  database system is shut down

I upgraded the primary, then I run the rsync command in the primary : 
rsync --archive --delete --hard-links --size-only --no-inc-recursive /var/lib/pgsql/data /var/lib/pgsql/11/data/ secondary_ip:/var/lib/pgsql/data/

in the secondary I checked the version file and it was 11 : 
[secondary]# cat PG_VERSION
11

Any idea how to handle it ?

Re: upgrade to PG11 on secondary fails (no initdb was launched)

От
Stephen Frost
Дата:
Greetings (moved to -admin, where it should be...),

* Greg Clough (Greg.Clough@ihsmarkit.com) wrote:
> > 2019-05-23 04:17:02 EDT  23593  DETAIL:  The database cluster was initialized with PG_CONTROL_VERSION 960, but the
serverwas compiled with PG_CONTROL_VERSION 1100. 
>
> It appears that you have not upgraded the standby server, so either use "rsync" or simply destroy and rebuild it from
scratch"repmgr standby clone..." 

You can't use the rsync method described in the pg_upgrade documentation
after the primary has been started, you'll end up with corruption.

Thanks,

Stephen

Вложения