On Thu, Sep 7, 2017 at 9:06 PM, James Sewell <james.sewell@xxxxxxxxxxxx> wrote: > A client has have been having problems with pg_rewind. > > They have two PostgreSQL (Oracle Enterprise Linux 7, 9.6.4) nodes in > streaming replication and follow these steps: > > 1. Stop the master > 2. Promote the standby > 3. After successful failover wait some time (a lot of data is written) > 4. Issue a checkpoint on the new master > 5. Issue a pg_rewind on the old master > 6. Start up the old master with a recovery.conf pointing at the new master. How are you stopping the primary at step 1)? If you stopped it cleanly, then it had the occasion to send to the standby the WAL record corresponding to the shutdown checkpoint, so at step 2) the standby would use a WAL history that has not forked from the primary when it is promoted, so the ex-primary could be reused as-is as a standby. Hence step 5 would not be necessary. -- Michael -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general