Re: Add macros for ReorderBufferTXN toptxn

Amit Kapila <amit.kapila16@gmail.com>

From: Amit Kapila <amit.kapila16@gmail.com>
To: vignesh C <vignesh21@gmail.com>
Cc: Peter Smith <smithpb2250@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-03-14T11:46:50Z
Lists: pgsql-hackers
On Tue, Mar 14, 2023 at 5:03 PM vignesh C <vignesh21@gmail.com> wrote:
>
> On Tue, 14 Mar 2023 at 12:37, Peter Smith <smithpb2250@gmail.com> wrote:
> >
>
> The same issue exists here too:
> 1)
> -       if (toptxn != NULL && !rbtxn_has_catalog_changes(toptxn))
> +       if (rbtxn_is_subtxn(txn))
>         {
> -               toptxn->txn_flags |= RBTXN_HAS_CATALOG_CHANGES;
> -               dclist_push_tail(&rb->catchange_txns, &toptxn->catchange_node);
> +               ReorderBufferTXN *toptxn = rbtxn_get_toptxn(txn);
>
> 2)
>  -       if (change->txn->toptxn)
> -               topxid = change->txn->toptxn->xid;
> +       if (rbtxn_is_subtxn(change->txn))
> +               topxid = rbtxn_get_toptxn(change->txn)->xid;
>
> If you plan to fix, bothe the above also should be handled.
>

I don't know if it would be any better to change the above two as
compared to what the proposed patch has.

-- 
With Regards,
Amit Kapila.



Commits

  1. Add macros for ReorderBufferTXN toptxn.