Re: abort-time portal cleanup

2019-10-10 Thread Amit Kapila
On Wed, Oct 9, 2019 at 6:56 PM Robert Haas wrote: > > On Tue, Oct 8, 2019 at 2:10 PM Andres Freund wrote: > > On 2019-10-07 12:14:52 -0400, Robert Haas wrote: > > > > - if (portal->status == PORTAL_READY) > > > > - MarkPortalFailed(portal); > > > > > > > > Why it is safe to remove this check?

Re: abort-time portal cleanup

2019-10-09 Thread Robert Haas
On Tue, Oct 8, 2019 at 2:10 PM Andres Freund wrote: > On 2019-10-07 12:14:52 -0400, Robert Haas wrote: > > > - if (portal->status == PORTAL_READY) > > > - MarkPortalFailed(portal); > > > > > > Why it is safe to remove this check? It has been explained in commit > > > 7981c342 why we need that

Re: abort-time portal cleanup

2019-10-08 Thread Andres Freund
Hi, On 2019-10-07 12:14:52 -0400, Robert Haas wrote: > > - if (portal->status == PORTAL_READY) > > - MarkPortalFailed(portal); > > > > Why it is safe to remove this check? It has been explained in commit > > 7981c342 why we need that check. I don't see any explanation in email > > or patch

Re: abort-time portal cleanup

2019-10-07 Thread Robert Haas
On Tue, Sep 24, 2019 at 6:34 AM Dilip Kumar wrote: > On Fri, Sep 13, 2019 at 2:13 AM Robert Haas wrote: > > > /* > * Otherwise, do nothing to cursors held over from a previous > * transaction. > */ > if (portal->createSubid == InvalidSubTransactionId) > continue; > > /* > * Do nothing to

Re: abort-time portal cleanup

2019-10-07 Thread Robert Haas
On Tue, Sep 24, 2019 at 5:31 AM Amit Kapila wrote: > After this cleanup, I think we don't need At(Sub)Abort_Portals in > AbortOutOfAnyTransaction() for the states TBLOCK_(SUB)ABORT and > friends. This is because AbortTransaction itself would have zapped the > portal. Not if the ROLLBACK itself

Re: abort-time portal cleanup

2019-09-27 Thread Robert Haas
On Tue, Sep 24, 2019 at 4:45 PM Andres Freund wrote: > Hm. Doing that cleanup requires digging through all the portals etc. I'd > rather rely on less state being correct than more during FATAL > processing. I agree with the principle, but the advantage of removing the hash table entries is that

Re: abort-time portal cleanup

2019-09-24 Thread Andres Freund
Hi, On 2019-09-12 16:42:46 -0400, Robert Haas wrote: > The trouble starts with the header comment for AtAbort_Portals, which > states that "At this point we run the cleanup hook if present, but we > can't release the portal's memory until the cleanup call." At the time > this logic was introduced

Re: abort-time portal cleanup

2019-09-24 Thread Dilip Kumar
On Fri, Sep 13, 2019 at 2:13 AM Robert Haas wrote: > /* * Otherwise, do nothing to cursors held over from a previous * transaction. */ if (portal->createSubid == InvalidSubTransactionId) continue; /* * Do nothing to auto-held cursors. This is similar to the case of a * cursor from a previous

Re: abort-time portal cleanup

2019-09-24 Thread Amit Kapila
On Fri, Sep 13, 2019 at 2:13 AM Robert Haas wrote: > > I've been studying At{Sub,}{Abort,Cleanup}_Portals() for the last few > days and have come to the conclusion that the code is not entirely up > to our usual standards. I believe that a good deal of the reason for > this is attributable to the

abort-time portal cleanup

2019-09-12 Thread Robert Haas
I've been studying At{Sub,}{Abort,Cleanup}_Portals() for the last few days and have come to the conclusion that the code is not entirely up to our usual standards. I believe that a good deal of the reason for this is attributable to the poor quality of the code comments in this area, although