Safe switchover

From: James Sewell <james(dot)sewell(at)jirotech(dot)com>
To: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Safe switchover
Date: 2020-07-10 00:05:52
Message-ID: CAANVwEv6Ttv0p74P0U8DemFdYejC=VRX2xvFA-nPHTZk=v-12Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I’m trying to work out a procedure for a safe zero data loss switchover
under (high) load, which allows the old master to be reconnected without
the use of pgrewind.

Would the following be sane?

- open connection to database
- smart shutdown master
- terminate all other connections
- wait for shutdown (archiving will finish)
- Identify last archived WAL file name (ensure it’s on backup server.)
- wait till a standby has applied this WAL
- promote that standby
- attach old master to new master

Cheers,
James Sewell
--
James Sewell,
*Chief Architect, Jirotech*
Suite 46, Jones Bay Wharf, 26-32 Pirrama Road, Pyrmont NSW 2009
*P *(+61) 2 8099 9000 <(+61)%202%208099%209000> *W* www.jirotech.com *F *
(+61) 2 8099 9099 <(+61)%202%208099%209000>

--
The contents of this email are confidential and may be subject to legal or
professional privilege and copyright. No representation is made that this
email is free of viruses or other defects. If you have received this
communication in error, you may not copy or distribute any part of it or
otherwise disclose its contents to anyone. Please advise the sender of your
incorrect receipt of this correspondence.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michel Pelletier 2020-07-10 00:14:49 Re: invalid non-zero objectSubId for object class
Previous Message Tom Lane 2020-07-09 23:18:00 Re: invalid non-zero objectSubId for object class