Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mZI9F-00057y-Hq for pgsql-admin@arkaria.postgresql.org; Sat, 09 Oct 2021 19:36:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mZI9D-0000ok-Av for pgsql-admin@arkaria.postgresql.org; Sat, 09 Oct 2021 19:36:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mZI9D-0000o0-1v for pgsql-admin@lists.postgresql.org; Sat, 09 Oct 2021 19:36:43 +0000 Received: from fortimail.cybercat.ca ([216.13.210.77]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mZI98-00055U-S4 for pgsql-admin@lists.postgresql.org; Sat, 09 Oct 2021 19:36:42 +0000 Received: from nicolasmaison (modemcable198.140-82-70.mc.videotron.ca [70.82.140.198]) (user=rossnick-lists%cybercat.net mech=LOGIN bits=0) by fortimail.cybercat.ca with ESMTP id 199JaZkF031968-199JaZkG031968 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 9 Oct 2021 15:36:35 -0400 From: "Nicolas Ross" To: References: In-Reply-To: Subject: RE: Slave stuck in recovery mode Date: Sat, 9 Oct 2021 15:36:35 -0400 Message-ID: <011501d7bd44$f8b70a10$ea251e30$@cybercat.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Content-Language: fr-ca Thread-Index: AQHqu9+kpKB0pYakQsrKw2z3kSDkC6ulEcew X-FEAS-AUTH-USER: rossnick-lists%cybercat.net List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I ended up googling some more and found this : https://www.enterprisedb.com/blog/be-sure-stop-your-backups Which is exactly what was happening. Even though I had no backup = running, I did the stop_backup command etc. I planned a restart of the master server, and then re-cloned, I was then = all OK ! Strange. -----Message d'origine----- De : Nicolas Ross =20 Envoy=C3=A9 : 8 octobre 2021 19:16 =C3=80 : pgsql-admin@lists.postgresql.org Objet : Slave stuck in recovery mode=20 Hi ! We=E2=80=99ve been using postgres since some time now (since the 9.3 days). I=E2=80=99ve got a pair of 9.6 server with 2 nodes, a primary and a slave. We use repmgr to manage the cluster. When it was installed, it was something like repmgr 4.x or even 3. This week, for some reason, I had to rebuild the slave instance. So I cloned the slave using a command like : /usr/pgsql-9.6/bin/repmgr -h pgserver2.qualite -U repmgr -f /etc/repmgr/9.6/repmgr.conf standby clone After some time (it=E2=80=99s like 250 gigs, so it=E2=80=99s kinda an = hour or 2), the command ends. If I start the postgres server on the slave with OS systemcl script, it doesn=E2=80=99t return to the CLI (presumably it waits for something). In the log I see : < 2021-10-08 16:16:47.861 EDT > LOG: database system was shut down in recovery at 2021-10-08 16:04:10 EDT < 2021-10-08 16:16:47.877 EDT > LOG: entering standby mode < 2021-10-08 16:16:48.599 EDT > LOG: redo starts at 13BF/CF000028 < 2021-10-08 16:16:52.899 EDT > LOG: consistent recovery state reached at 13BF/D53BA0F0 (Some time passes) < 2021-10-08 16:46:10.363 EDT > LOG: started streaming WAL from primary at 13C9/8C000000 on timeline 1 After that, if I try to connect to the slave, I get : FATAL: the database system is starting up No matter how long I wait (tried more than a day later). During that time, the master still streams the wal to the slave. Notes : That last log example was taken after trying to clone from our barman server (tried with and without) use_replication_slots is set to yes. hot_standby is on on the primary, hence when cloned it is also. Before one of my clone command, I=E2=80=99ve tried cleaning all residue of repmgr, ie remove the extension, re-register the master, etc, still the same issue. If I comment out hot_standby on the slave, it starts normally, but still doesn=E2=80=99t allow connections. Recovery.conf is : standby_mode =3D 'on' primary_conninfo =3D 'host=3DMASTERIP user=3Drepmgr application_name=3DSLAVENAME' recovery_target_timeline =3D 'latest' primary_slot_name =3D 'repmgr_slot_1' Any help troubleshooting this would be appreciated !