pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Pilar de Teodoro <pilar.deteodoro@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: postgres replication without pg_basebackup? postgres 13.3
Date: Tue, 08 Nov 2022 04:27:46 +0100
Message-ID: <785bc009a9b1cb2564fdf0e8e17bdf0960504fe5.camel@cybertec.at> (raw)
In-Reply-To: <CAH98rhGmFQBR-ur1L8BPAUW1H9zRBktPYUzUuhi3TQ5k2Chw2A@mail.gmail.com>
References: <CAH98rhHdZEhjhxsA8_Z_bZ+WvYtgHau8UgaZmVts9jg8NJ1H6Q@mail.gmail.com>
	<682616b88f9e6bd7a745d74580833254879ce550.camel@cybertec.at>
	<CAH98rhGmFQBR-ur1L8BPAUW1H9zRBktPYUzUuhi3TQ5k2Chw2A@mail.gmail.com>

On Mon, 2022-11-07 at 23:11 +0100, Pilar de Teodoro wrote:
> Thank you very much for the idea. [of running pg_rewind]
> We ran pg_rewind correctly:
> [postgres@gacsdb05 data-13.3]$ pg_rewind -c -R --target-pgdata=/PostgresDB/sas_hdd/data-13.3/  --source-server="host=XXXX port=XXXX user=postgres password=XXX" 
> pg_rewind: source and target cluster are on the same timeline
> pg_rewind: no rewind required

I cannot verify that you ran it correctly.

"Target" should be the old server with the extra transactions.
"Source" should be the promoted standby server.  Promotion switches to a new timeline,
so it looks like you did something wrong.

> but then we got the following error:
> 
> [2022-11-07 22:57:55 CET-]LOG:  starting PostgreSQL 13.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10), 64-bit
> [2022-11-07 22:57:55 CET-]LOG:  listening on IPv4 address "0.0.0.0", port XXXX
> [2022-11-07 22:57:55 CET-]LOG:  could not create IPv6 socket for address "::": Address family not supported by protocol
> [2022-11-07 22:57:55 CET-]LOG:  listening on Unix socket "/tmp/.s.PGSQL.XXXX"
> [2022-11-07 22:57:55 CET-]LOG:  database system was shut down in recovery at 2022-11-07 22:57:47 CET
> [2022-11-07 22:57:55 CET-]LOG:  restored log file "00000003.history" from archive
> cp: cannot stat '/PostgresWalLogArchive/new/00000004.history': No such file or directory
> [2022-11-07 22:57:55 CET-]LOG:  entering standby mode
> [2022-11-07 22:57:55 CET-]LOG:  restored log file "00000003.history" from archive
> [2022-11-07 22:57:55 CET-]LOG:  invalid primary checkpoint record
> [2022-11-07 22:57:55 CET-]PANIC:  could not locate a valid checkpoint record
> [2022-11-07 22:57:55 CET-]LOG:  startup process (PID 3011860) was terminated by signal 6: Aborted
> [2022-11-07 22:57:55 CET-]LOG:  aborting startup due to startup process failure
> [2022-11-07 22:57:55 CET-]LOG:  database system is shut down
> 
> We have read we can run pg_resetwal but the Wal folder is the folder where the Wals are archived in the primary. Would that be correct to reset them?

Don't run "pg_resetwal".  At the very least, it will break your standby.

At this point, your standby seems to be broken.  I don't know what exactly you
did, but it leeks like you should run a "pg_basebackup" after all.

Yours,
Laurenz Albe





view thread (4+ messages)

Message-ID: <785bc009a9b1cb2564fdf0e8e17bdf0960504fe5.camel@cybertec.at>
Permalink:  ../785bc009a9b1cb2564fdf0e8e17bdf0960504fe5.camel@cybertec.at/
Also on:    postgresql.org/message-id/785bc009a9b1cb2564fdf0e8e17bdf0960504fe5.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, pilar.deteodoro@gmail.com
  Subject: Re: postgres replication without pg_basebackup? postgres 13.3
  In-Reply-To: <785bc009a9b1cb2564fdf0e8e17bdf0960504fe5.camel@cybertec.at>
  References: <CAH98rhHdZEhjhxsA8_Z_bZ+WvYtgHau8UgaZmVts9jg8NJ1H6Q@mail.gmail.com> <682616b88f9e6bd7a745d74580833254879ce550.camel@cybertec.at> <CAH98rhGmFQBR-ur1L8BPAUW1H9zRBktPYUzUuhi3TQ5k2Chw2A@mail.gmail.com> <785bc009a9b1cb2564fdf0e8e17bdf0960504fe5.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox