Re: VM map freeze corruption

From: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: "Wood, Dan" <hexpert(at)amazon(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VM map freeze corruption
Date: 2018-04-19 18:39:58
Message-ID: CABOikdNzi8qTJ=kn3NBE3=Lxvijw5vT+BhGJ7qvzpDrA_6abOA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 18, 2018 at 7:06 PM, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
wrote:

>
>
> IMO the cause is the totally_frozen variable, which starts life in a
> bogus state (true) and the different code paths can set it to the right
> state, or by inaction end up deciding that the initial bogus state was
> correct in the first place. Errors of omission are far too easy in that
> kind of model, ISTM, so I propose this slightly different patch, which
> albeit yet untested seems easier to verify and easier to get right.
>

I wonder if we should just avoid initialising those variables at the top
and take compiler's help to detect any missed branches. That way, we shall
know exactly why and where we are making them true/false. I also think that
we should differentiate between scenarios where xmin/xmax is already frozen
and scenarios where we are freezing them now.

I come up with attached. Not fully polished (and there is a XXX that I left
for comments), but hopefully enough to tell what I am thinking. Do you
think it's any improvement or actually makes the problem worse?

Thanks,
Pavan

--
Pavan Deolasee http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
frozen_v2.patch application/octet-stream 3.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2018-04-19 18:59:57 Re: Corrupted btree index on HEAD because of covering indexes
Previous Message Peter Geoghegan 2018-04-19 18:39:05 Re: Corrupted btree index on HEAD because of covering indexes