pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martín Fernández <fmartin91@gmail.com>
To: pgsql-general@postgresql.org
Subject: Reindex "locked" standby database
Date: Wed, 15 Dec 2021 00:15:27 -0300
Message-ID: <6C5D7205-487C-4AED-93AC-FBE042F51FC9@gmail.com> (raw)

Hello pg hackers!

Today we had to run a `REINDEX table CONCURRENTLY my_table;` in our production database due to considerable index bloat. We used to deal with this problem in the past by using pg_repack but we stopped using it because our data replication tool doesn’t support “re creating” tables in the way that pg_repack does it (we are using Fivetran).

The reindex went fine in the primary database and in one of our standby. The other standby that we also operate for some reason ended up in a state where all transactions were locked by the WAL process and the WAL process was not able to make any progress. In order to solve this issue we had to move traffic from the “bad” standby to the healthy one and then kill all transactions that were running in the “bad” standby. After that, replication was able to resume successfully. 

I’m just trying to understand what could have caused this issue. I was not able to identify any queries in the standby that would be locking the WAL process. Any insight would be more than welcome!

We are running pg12 in our cluster and standbys are replicating using physical replication lots.

Best,
Martín




view thread (5+ messages)  latest in thread

Message-ID: <6C5D7205-487C-4AED-93AC-FBE042F51FC9@gmail.com>
Permalink:  ../6C5D7205-487C-4AED-93AC-FBE042F51FC9@gmail.com/
Also on:    postgresql.org/message-id/6C5D7205-487C-4AED-93AC-FBE042F51FC9@gmail.com

 · 

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: fmartin91@gmail.com
  Subject: Re: Reindex "locked" standby database
  In-Reply-To: <6C5D7205-487C-4AED-93AC-FBE042F51FC9@gmail.com>
  References: <6C5D7205-487C-4AED-93AC-FBE042F51FC9@gmail.com>

* 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