Re: pg_upgrade and rsync

From: Vladimir Borodin <root(at)simply(dot)name>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade and rsync
Date: 2015-03-04 10:53:47
Message-ID: B7A74A80-43A2-498D-8A45-2CB3EFCC3DA8@simply.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> 3 марта 2015 г., в 18:01, Bruce Momjian <bruce(at)momjian(dot)us> написал(а):
>
> On Tue, Mar 3, 2015 at 04:55:56PM +0300, Vladimir Borodin wrote:
>> OK, hmmm. Thanks for testing. It feels like you didn't have your new
>> master set up for streaming replication when you ran pg_upgrade. Is
>> that correct? Should I specify that specifically in the instructions?
>>
>>
>> After running pg_upgrade I do put in new PGDATA on master old pg_hba.conf and
>> postgresql.conf with wal_level = hot_standby. The full content of
>> postgresql.conf could be seen here - http://pastie.org/9995902. Then I do rsync
>> to replica, put recovery.conf and try to start both - first master, then
>> replica. If I turn off hot_standby in replica configuration, it starts. What am
>> I doing wrong?
>
> After running initdb to create the new master, but before running
> pg_upgrade, modify the new master's postgresql.conf and change wal_level
> = hot_standby. (Don't modify pg_hba.conf at this stage.)
>

That does not help. The reason is that pg_upgrade sets 'Current wal_level setting: minimal' in control-file, and it does not depend on what is set in postgresql.conf before running pg_upgrade. Details could be seen here - http://pastie.org/9998671 <http://pastie.org/9998671>.

The workaround for this is to start and cleanly shut down postgres on master after running pg_upgrade but before running rsync. After that there would be a good control-file for streaming replication and rsync to replica can be done. But it could not be done with --size-only key, because control-file is of fixed size and rsync would skip it. Or may be everything should be copied with --size-only and control-file should be copied without this option.

> I didn't think that was necessary, but this might be some 9.3-specific
> problem, but let's get it working first.
>
> --
> Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
> EnterpriseDB http://enterprisedb.com
>
> + Everyone has their own god. +

--
Да пребудет с вами сила…
https://simply.name/ru

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Syed, Rahila 2015-03-04 11:02:58 Re: [REVIEW] Re: Compression of full-page-writes
Previous Message Ashutosh Bapat 2015-03-04 10:17:02 Re: Join push-down support for foreign tables