Re: Postgres HA issue - Standby server does not start after Mastercompute host is shut down - Mailing list pgsql-general

From Luca Ferrari
Subject Re: Postgres HA issue - Standby server does not start after Mastercompute host is shut down
Date
Msg-id CAKoxK+7AX8Fj-95etVmx_NjU049rrK1Zj9UYy6XAwax+Sn5gyg@mail.gmail.com
Whole thread Raw
In response to Re: Postgres HA issue - Standby server does not start after Mastercompute host is shut down  (Nagendra Bandi <nagendra.bandi@gmail.com>)
List pgsql-general
On Tue, Sep 3, 2019 at 6:08 PM Nagendra Bandi <nagendra.bandi@gmail.com> wrote:
> Standby is built from the primary using pg_basebackup. i.e. Initial copy of the primary database is taken with
pg_basebackupcommand and then restarted the server.
 

This puzzles me:

< 2019-09-01 15:43:56.440 UTC >LOG:  trigger file found:
/var/opt/rh/rh-postgresql94/lib/pgsql/trigger_switch
< 2019-09-01 15:43:56.440 UTC >FATAL:  terminating walreceiver process
due to administrator command

< 2019-09-01 15:43:56.443 UTC >DEBUG:  switched WAL source from stream
to archive after failure
< 2019-09-01 15:43:56.443 UTC >LOG:  record with zero length at C/95193A70
< 2019-09-01 15:43:56.443 UTC >LOG:  redo done at C/95193A38
< 2019-09-01 15:43:56.443 UTC >LOG:  last completed transaction was at
log time 2019-09-01 15:39:18.804265+00
< 2019-09-01 15:43:56.443 UTC >DEBUG:  resetting unlogged relations:
cleanup 0 init 1
< 2019-09-01 15:43:56.448 UTC >FATAL:  WAL ends before end of online backup
< 2019-09-01 15:43:56.448 UTC >HINT:  All WAL generated while online
backup was taken must be available at recovery.

so the standby found the trigger file and terminated the wal receiver,
but then tried to get wals from local archive, why?
Seems to me the local WALs are not completed or removed, and so the
standby cannot get the last part, I suspect this is because there's a
restore_command that is not streaming (and that should be fine, since
it is optional for streaming).
Also the version is quite old.

Luca



pgsql-general by date:

Previous
From: "Jehan-Guillaume (ioguix) de Rorthais"
Date:
Subject: Re: Postgres HA issue - Standby server does not start after Mastercompute host is shut down
Next
From: "Kumar, Virendra"
Date:
Subject: RE: Running a Simple Update Statement Fails, Second Time Suceeds.