From: zhihuifan1213@163.com
To: 费长红 <feichanghong@qq.com>
Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Subject: Re: 回复: BUG #18213: Standby's repeatable read isolation level transaction encountered a "nonrepeatable read" problem
Date: Wed, 29 Nov 2023 15:50:00 +0800
Message-ID: <87zfyxj88c.fsf@163.com> (raw)
In-Reply-To: <tencent_2F3B410655A7D447BF092A470CC297D2DA06@qq.com>
References: <18213-dbcf8d67b0e687f5@postgresql.org>
<87cyvtkspj.fsf@163.com>
<tencent_2F3B410655A7D447BF092A470CC297D2DA06@qq.com>
"费长红" <feichanghong@qq.com> writes:
> -------------------------------------------------------------------------------------------------------------------------
>
> * 起个啥名好呢
> feichanghong@qq.com
>
> Indeed, I simply implemented and verified the solution. In the above test, the "create index" command on RW will hang
> until the transaction on standby is committed or aborted.
I think this is acceptable since its behavior is same as we wait for the
transactions in primary.
> In addition, even if there is no select query on the standby, RW's "create index" command may wait for a period of time,
> which affected by the wal_receiver_status_interval parameter.
The "wait" happens at the very last of index building, so the building
stages gives an enough time for standby to exceeds the xmin, so in a
real case, I think the overhead will be pretty low.
> You can see attachment for the patch.
I take a look at the that, function GetReplicationSlotXmin should be not
needed. You can use ProcArrayGetReplicationSlotXmin directly.
After searching the caller of WaitForOlderSnapshots, I think this bug
probably has impact on "deteach partition concurrently" / "reindex
concurrently" features. All of them needs the same fix.
--
Best Regards
Andy Fan
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: zhihuifan1213@163.com, feichanghong@qq.com, pgsql-bugs@lists.postgresql.org
Subject: Re: 回复: BUG #18213: Standby's repeatable read isolation level transaction encountered a "nonrepeatable read" problem
In-Reply-To: <87zfyxj88c.fsf@163.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