Re: Old row version in hot chain become visible after a freeze

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, "Wood, Dan" <hexpert(at)amazon(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, "Wong, Yi Wen" <yiwong(at)amazon(dot)com>
Subject: Re: Old row version in hot chain become visible after a freeze
Date: 2017-09-12 12:32:12
Message-ID: CAB7nPqSspx00vRNzXDR7=+=CjWsCY2sxUae6oY7EjwKiBNBd6Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Sep 12, 2017 at 5:22 PM, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
> Michael Paquier wrote:
>> On Mon, Sep 11, 2017 at 11:01 PM, Alvaro Herrera
>> <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
>> > (I also threw in a small sleep between heap_page_prune and
>> > HeapTupleSatisfiesVacuum while testing, just to widen the problem window
>> > to hopefully make any remaining problems more evident.)
>>
>> I am understanding that you mean heap_prepare_freeze_tuple here
>> instead of heap_page_prune.
>
> Hmm ... no, I meant adding a sleep after the page is pruned, before
> HeapTupleSatisfiesVacuum call that determines the action with regards to
> freezing.

Well, I have tested both. With the test case of Dan adding a sleep
after calling HeapTupleSatisfiesVacuum() helped in increasing the
window. Of course feel free to correct me.

>> Using again the test of Dan at the top of the thread, I am seeing from
>> time to time what looks like garbage data in xmax, like that:
>> ctid | xmin | xmax | id
>> -------+------+------+----
>> (0,1) | 620 | 0 | 1
>> (0,7) | 625 | 84 | 3
>> (2 rows)
>> [...]
>> ctid | xmin | xmax | id
>> -------+------+------+----
>> (0,1) | 656 | 0 | 1
>> (0,6) | 661 | 128 | 3
>> (2 rows)
>
> I bet those are multixact values rather than garbage. You should see
> HEAP_XMAX_IS_MULTI in t_infomask in those cases, and the values should
> be near NextMultiXactId (make sure to checkpoint if you examine with
> pg_controldata; I think it's easier to obtain it from shmem. Or you
> could just use pg_get_multixact_members()).

Yes, you're right. That's the case. So I guess that I don't have much
complains about the patch as presented.
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2017-09-12 12:41:36 Re: Old row version in hot chain become visible after a freeze
Previous Message Maksim Karaba 2017-09-12 08:35:12 Re: BUG #14781: server process was terminated by signal 11: Segmentation fault