From: Ben Chobot <bench@silentmedia.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #17401: REINDEX TABLE CONCURRENTLY creates a race condition on a streaming replica
Date: Tue, 8 Feb 2022 20:28:39 -0800
Message-ID: <07ad5e5b-2176-5c7d-dfa7-7f63231df22b@silentmedia.com> (raw)
In-Reply-To: <YgMafbZE9jziXoMi@paquier.xyz>
References: <17401-9df851bb16dde397@postgresql.org>
<CAH2-WzmtWJN_q51XoXu8j5mroA9TmzqhQRh1VcWFwgkxTNmRwg@mail.gmail.com>
<YgMafbZE9jziXoMi@paquier.xyz>
Michael Paquier wrote on 2/8/22 5:35 PM:
> On Tue, Feb 08, 2022 at 01:23:34PM -0800, Peter Geoghegan wrote:
>> I find the idea that we'd fail to WAL-log information that is needed
>> during Hot Standby (to prevent this race condition) plausible.
>> Michael?
> Yeah, REINDEX relies on some existing index definition, so it feels
> like we are missing a piece related to invalid indexes in all that. A
> main difference is the lock level, as exclusive locks are getting
> logged so the standby can react and wait on that. The 30-minute mark
> is interesting. Ben, did you change any replication-related GUCs that
> could influence that? Say, wal_receiver_timeout, hot_standby_feedback
> or max_standby_streaming_delay?
Oh, to be clear, the 30 minute mark is more "the loop has always failed
this far into it" and sometimes that's 5 minutes and sometimes it's
more, but I've never seen it take more than somewhere in the 20s. I was
thinking it was just because of the race condition, but, to answer your
question, yes, we have tuned some replication parameters. Here are the
ones you asked about; did you want to see the value of any others?
=# show wal_receiver_timeout ;
wal_receiver_timeout
──────────────────────
1min
(1 row)
04:26:27 db: postgres@postgres, pid:29507
=# show hot_standby_feedback ;
hot_standby_feedback
──────────────────────
on
(1 row)
04:26:40 db: postgres@postgres, pid:29507
=# show max_standby_streaming_delay ;
max_standby_streaming_delay
─────────────────────────────
10min
(1 row)
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: bench@silentmedia.com, michael@paquier.xyz, pg@bowt.ie, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17401: REINDEX TABLE CONCURRENTLY creates a race condition on a streaming replica
In-Reply-To: <07ad5e5b-2176-5c7d-dfa7-7f63231df22b@silentmedia.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