Re: POC: Cleaning up orphaned files using undo logs

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: POC: Cleaning up orphaned files using undo logs
Date: 2019-07-17 06:35:26
Message-ID: CAA4eK1+j5ioj-MsRM6Na4F0SQyGEUPPyJ6DOYZh93ThUSv031w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 16, 2019 at 9:52 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Tue, Jul 16, 2019 at 7:13 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> > > I also strongly suspect it is altogether wrong to do
> > > this before CommitSubTransaction sets s->state to TRANS_COMMIT; what
> > > if a subxact callback throws an error?
> >
> > Are you worried that it might lead to the execution of actions twice?
>
> No, I'm worried that you are running code that is part of the commit
> path before the transaction has actually committed.
> CommitSubTransaction() is full of stuff which basically propagates
> whatever the subtransaction did out to the parent transaction, and all
> of that code runs after we've ruled out the possibility of an abort,
> but this very-similar-looking code runs while it's still possible for
> an abort to happen. That seems unlikely to be correct, and even if it
> is, it seems needlessly inconsistent.
>

Fair point, will change as per your suggestion.

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Westermann (DWE) 2019-07-17 06:42:13 Fw: Documentation fix for adding a column with a default value
Previous Message Amit Kapila 2019-07-17 06:27:43 Re: POC: Cleaning up orphaned files using undo logs