Re: mvcc catalo gsnapshots and TopTransactionContext - Mailing list pgsql-hackers

From Andres Freund
Subject Re: mvcc catalo gsnapshots and TopTransactionContext
Date
Msg-id 1f5541d8-a70e-4903-8343-30a5dda709c0@email.android.com
Whole thread Raw
In response to Re: mvcc catalo gsnapshots and TopTransactionContext  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: mvcc catalo gsnapshots and TopTransactionContext  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On February 2, 2014 5:52:22 PM CET, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>Andres Freund <andres@2ndquadrant.com> writes:
>> On 2014-01-31 16:41:33 -0500, Bruce Momjian wrote:
>>> Is there any plan to commit this?
>
>> IMO it has to be applied. Tom objected on the grounds that cache
>> invalidation has to be fixed properly but that's a major
>restructuring
>> of code that worked this way for a long time. So changing the
>Assert()
>> to reflect that seems fair to me.
>
>The replacement Assert is wrong no?  At least that's what was said
>upthread.

Well, no. Noah's version isn't as strict as desirable, but it doesn't trigger in wrong cases. Thus still better than
what'sin 9.3 (nothing).
 

> More to the point, changing the Assert so it doesn't fire
>doesn't do one damn thing to ameliorate the fact that cache reload
>during transaction abort is wrong and unsafe.

And, as upthread, I still don't think that's correct. I don't have sources available right now, but IIRC we already
haveaborted out of the transaction. Released locks, the xid and everything. We just haven't changed the state yet - and
affairwe can't naively do so, otherwise we'd do incomplete cleanups if we got interrupted somehow.
 
So yes, it's not pretty and it's really hard to verify. But that doesn't make it entirely wrong.
I don't see the point of an assert that triggers for code (and coders) that can't do anything about it because their
codeis correct. All the while the assertion actually triggers for ugly but correct code.
 

Andres


-- 
Please excuse brevity and formatting - I am writing this on my mobile phone.

Andres Freund                       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Recovery inconsistencies, standby much larger than primary
Next
From: Greg Stark
Date:
Subject: Re: Recovery inconsistencies, standby much larger than primary