From: | Simon Riggs <simon(at)2ndQuadrant(dot)com> |
---|---|
To: | Simon Riggs <simon(at)2ndquadrant(dot)com> |
Cc: | Andres Freund <andres(at)anarazel(dot)de>, Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Relation cache invalidation on replica |
Date: | 2016-02-27 01:16:34 |
Message-ID: | CANP8+jKtJmfZcfwqe8p_DZwQKPUywq8hZ-KvLoe7ri3nPX0yLQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 27 February 2016 at 00:33, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> On 27 February 2016 at 00:29, Andres Freund <andres(at)anarazel(dot)de> wrote:
>
>> On 2016-02-26 18:05:55 +0300, Konstantin Knizhnik wrote:
>> > The reason of the problem is that invalidation messages are not
>> delivered to
>> > replica after the end of concurrent create index.
>> > Invalidation messages are included in xlog as part of transaction commit
>> > record.
>> > Concurrent index create is split into three transaction, last of which
>> is
>> > just performing inplace update of index tuple, marking it as valid and
>> > invalidating cache. But as far as this transaction is not assigned XID,
>> no
>> > transaction record is created in WAL and send to replicas. As a result,
>> > replica doesn't receive this invalidation messages.
>>
>> Ugh, that's a fairly ugly bug.
>
>
> Looking now.
>
If the above is true, then the proposed fix wouldn't work either.
No point in sending a cache invalidation message on the standby if you
haven't also written WAL, since the catalog re-read would just see the old
row.
heap_inplace_update() does write WAL, which blows away the starting premise.
So I'm not seeing this as an extant bug in an open source version of
PostgreSQL, in my current understanding.
--
Simon Riggs http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/>
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2016-02-27 01:23:18 | Re: Relation cache invalidation on replica |
Previous Message | Andrew Dunstan | 2016-02-27 00:49:50 | Re: pgsql: Respect TEMP_CONFIG when running contrib regression tests. |