Re: WIP: long transactions on hot standby feedback replica / proof of concept

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Ivan Kartyshov <i(dot)kartyshov(at)postgrespro(dot)ru>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WIP: long transactions on hot standby feedback replica / proof of concept
Date: 2017-11-05 20:23:01
Message-ID: CA+TgmoY1=GVNO1Ffe6o7sM8jkg7123ngwkvu52QsaZxxThkZtw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 3, 2017 at 5:57 PM, Alexander Korotkov
<a(dot)korotkov(at)postgrespro(dot)ru> wrote:
> On Thu, Nov 2, 2017 at 5:56 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> > I can propose following alternative approach: teach read-only queries on
>> > hot
>> > standby to tolerate concurrent relation truncation. Therefore, when
>> > non-existent heap page is accessed on hot standby, we can know that it
>> > was
>> > deleted by concurrent truncation and should be assumed to be empty. Any
>> > thoughts?
>>
>> Sounds like it might break MVCC?
>
> I don't know why it might be broken. VACUUM truncates heap only when tail
> to be truncated is already empty. When applying truncate WAL record,
> previous WAL records deleting all those tuples in the tail are already
> applied. Thus, if even MVCC is broken and we will miss some tuples after
> heap truncation, they were anyway were gone before heap truncation.

Ah - I was thinking of the TRUNCATE command, rather than truncation by
VACUUM. Your argument makes sense, although the case where the
relation is truncated and later re-extended might need some thought.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2017-11-05 21:04:12 Re: Display number of heap accesses for index scans
Previous Message Oleg Bartunov 2017-11-05 19:22:53 Re: Custom compression methods