Postgres switchover and switchback

From: David Jordan <itman73(at)protonmail(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Postgres switchover and switchback
Date: 2022-05-18 14:23:55
Message-ID: 002501d86ac2$e0faeb90$a2f0c2b0$@protonmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi, folks;

I’m a former Oracle database administrator of many years who is new to PostgreSQL. I’m in the process of testing PG v12.7 hot streaming standby’s in async mode, and specifically in the areas of switchover and switchback.

I have set up test primary’s and created standby’s successfully with pg_basebackup. I can switch over/switch roles (standby -> primary, primary -> standby) successfully one time. When I switch roles a second time, the standby becomes primary just fine but the primary to standby fails to open properly. Logfile messages for both primary and standby are attached as well as pg_wal directory lists.

I shut down the primary first and then promote the standby. The only action I take on the standby side is to set the standby.signal file in $PGDATA. (Well almost. Initially, I do have to have an empty 00000000.history file in the archive locations or the standby’s fail to start.)

My archive directories are independent from each other and the archive command is the given test … cp -p example in the docs. Archive is ‘on’ on both sides.

Are there manual steps I’m should be completing before starting up new standby? So far, I’ve found the switching of roles to be less than guaranteed.

I would appreciate review of the attached logs to help pinpoint the issue. Inst1 is the initial primary, and inst2 is the initial standby.

Many thanks!
David

Attachment Content-Type Size
inst1_log.txt text/plain 4.0 KB
inst2_log.txt text/plain 6.9 KB
inst1_pg_wal_dir.txt text/plain 675 bytes
inst2_pg_wal_dir.txt text/plain 634 bytes

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jeff Janes 2022-05-19 03:46:37 Re: How to get a more RSYNC compatible output of pg_dump?
Previous Message Thorsten Schöning 2022-05-16 18:54:54 Re: How to get a more RSYNC compatible output of pg_dump?