Amit Kapila <amit.kapila16@gmail.com> wrote:
> On Wed, Nov 25, 2020 at 8:00 PM Antonin Houska <ah@cybertec.at> wrote:
> > I meant that AbortOutOfAnyTransaction should PANIC itself if it sees that
> > there is unapplied undo, so nothing changes for its callers. Do I still miss
> > something?
> >
>
> Adding PANIC in some generic code-path sounds scary. Why can't we
> simply try to execute undo?
Indeed it should try. I imagined it this way but probably got distracted by
some other thought when writing the email :-)
> > Actually I hit the problem of missing connection when playing with the
> > "undoxacttest" module. Those tests use table_open() / table_close() functions,
> > but it might not be necessary for the real RMGRs.
> >
>
> How can we apply the action on a page without opening the relation?
If the undo record contains RelFileNode, ReadBufferWithoutRelcache() can be
used, just like it happens with WAL. Not sure how much it would affect zheap.
--
Antonin Houska
Web: https://www.cybertec-postgresql.com