From: | 邱宇航 <iamqyh(at)gmail(dot)com> |
---|---|
To: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Optimization for hot standby XLOG_STANDBY_LOCK redo |
Date: | 2020-05-06 02:36:28 |
Message-ID: | 14878CE9-D0DF-4B8F-ACF5-59514E3D2CAE@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
I mean that all resources protected by XLOG_STANDBY_LOCK should redo later.
The semantics of XLOG_STANDBY_LOCK is still kept.
> 2020年4月30日 下午7:12,Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> 写道:
>
> On Thu, Apr 30, 2020 at 4:07 PM 邱宇航 <iamqyh(at)gmail(dot)com> wrote:
>>
>> I noticed that in hot standby, XLOG_STANDBY_LOCK redo is sometimes block by another query, and all the rest redo is blocked by this lock getting operation, which is not good and often happed in my database, so the hot standby will be left behind and master will store a lot of WAL which can’t be purged.
>>
>> So here is the idea:
>> We can do XLOG_STANDBY_LOCK redo asynchronously, and the rest redo will continue.
>>
>
> Hmm, I don't think we can do this. The XLOG_STANDBY_LOCK WAL is used
> for AccessExclusiveLock on a Relation which means it is a lock for a
> DDL operation. If you skip processing the WAL for this lock, the
> behavior of queries running on standby will be unpredictable.
> Consider a case where on the master, the user has dropped the table
> <t1> and when it will replay such an operation on standby the
> concurrent queries on t1 will be blocked due to replay of
> XLOG_STANDBY_LOCK WAL and if you skip that WAL, the drop of table and
> query on the same table can happen simultaneously leading to
> unpredictable behavior.
>
> --
> With Regards,
> Amit Kapila.
> EnterpriseDB: http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | 邱宇航 | 2020-05-06 03:05:06 | Re: Optimization for hot standby XLOG_STANDBY_LOCK redo |
Previous Message | Jonathan S. Katz | 2020-05-06 00:27:46 | Re: Another modest proposal for docs formatting: catalog descriptions |