Re: Postgres HA issue - Standby server does not start after Master compute host is shut down

From: Luca Ferrari <fluca1978(at)gmail(dot)com>
To: Nagendra Bandi <nagendra(dot)bandi(at)gmail(dot)com>
Cc: "Jehan-Guillaume (ioguix) de Rorthais" <ioguix(at)free(dot)fr>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Postgres HA issue - Standby server does not start after Master compute host is shut down
Date: 2019-09-04 09:14:32
Message-ID: CAKoxK+7AX8Fj-95etVmx_NjU049rrK1Zj9UYy6XAwax+Sn5gyg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Sep 3, 2019 at 6:08 PM Nagendra Bandi <nagendra(dot)bandi(at)gmail(dot)com> wrote:
> Standby is built from the primary using pg_basebackup. i.e. Initial copy of the primary database is taken with pg_basebackup command 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kumar, Virendra 2019-09-04 15:02:26 RE: Running a Simple Update Statement Fails, Second Time Suceeds.
Previous Message Jehan-Guillaume (ioguix) de Rorthais 2019-09-04 08:36:00 Re: Postgres HA issue - Standby server does not start after Master compute host is shut down