Re: pg_rewind

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: soumik(dot)bhattacharjee(at)kpn(dot)com
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org, pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_rewind
Date: 2020-01-28 08:48:09
Message-ID: 7389f3b042bed5d6b8fcf4cbf890fc932bc7963e.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, 2020-01-27 at 16:01 +0000, soumik(dot)bhattacharjee(at)kpn(dot)com wrote:
> I set the "wal_log_hints = on" , but enabling this parameter "on" in new MASTER(old SLAVE) needs a restart--
> which I cannot do as all application transactions are going on there now.
>
> Also I used pg_rewind in old MASTER(which now I want to make as new SLAVE) and it was successful,
> but this also needs restart of new MASTER(old SLAVE) which is again an issue.
>
> Command used: ./pg_rewind -D $PGDATA --source-server='host=<IP Address> port=5432 user=postgres password=xxxx
>
> Could you please suggest how to get this to work to keep the MASTER(old SLAVE) up & running and make the old MASTER(new SLAVE)

If you want to use "pg_rewind", you have to plan for that ahead of time
by either using data page checksums or enabling "wal_log_hints".

The first requires longer don time, the second a restart.
There is no way to do that retroactively.

Just use "pg_basebackup" to create a new standby, and enable
"wal_log_hints" next time you get a chance to restart.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message dbatoCloud Solution 2020-01-30 07:16:32 Looking for postgresql database administration guidelines needed for pg clustering activities
Previous Message soumik.bhattacharjee 2020-01-27 16:01:12 RE: pg_rewind