Re: uninterruptable loop: concurrent delete in progress within table - Mailing list pgsql-bugs

From Tom Lane
Subject Re: uninterruptable loop: concurrent delete in progress within table
Date
Msg-id 29094.1402177752@sss.pgh.pa.us
Whole thread Raw
In response to Re: uninterruptable loop: concurrent delete in progress within table  (Kevin Grittner <kgrittn@ymail.com>)
Responses Re: uninterruptable loop: concurrent delete in progress within table  (Kevin Grittner <kgrittn@ymail.com>)
List pgsql-bugs
Kevin Grittner <kgrittn@ymail.com> writes:
> Have we really pinned down the semantics of the the return values
> for HeapTupleSatisfiesVacuum() at this point?

Well, now that Andres unilaterally redefined HEAPTUPLE_INSERT_IN_PROGRESS
as meaning whatever the heck was easiest, I'd say no ;-).  But we have to
think about what we do want from it.  I'm not sure that we can positively
guarantee to distinguish all the possible states of an update-in-progress
tuple from outside the updating backend, and it likely would not be worth
the trouble to try since the answer could change at any instant anyway.

For the statistical purposes I was on about in the other thread, I would
be satisfied if we could distinguish "will be live if all relevant
transactions commit" from "will be dead if all relevant transactions
commit".  For other combinations like will-be-live-if-deleting-
subtransaction-rolls-back-but-outer-transaction-commits, there's really
no way for VACUUM to decide whether to count the tuple as live anyway.
Yet it'd be nice if we produced a live-tuple-count estimate that had some
relationship to reality in *some* scenario, and everything-commits seems
like the best choice of assumption.

It sounds like SSI might have some different requirements --- can you
specify what you need?

> What the code in predicate.c is using this for is to determine, for
> a given tuple which the calling process is reading, whether it is
> visible to the calling process but has been deleted by another
> transaction (whose work this snapshot can't see), or is not visible
> to the calling process and has been inserted by another transaction
> (whose work this transaction can't see).

I'm not sure why you'd need HeapTupleSatisfiesVacuum for that at all
--- it sounds like a plain visible-according-to-query-snapshot test.
Certainly HTSV is unconcerned with visibility as such, so it can't
satisfy this requirement by itself.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: uninterruptable loop: concurrent delete in progress within table
Next
From: Kevin Grittner
Date:
Subject: Re: uninterruptable loop: concurrent delete in progress within table