On Wed, Mar 15, 2023 at 4:55 PM Masahiko Sawada <sawada.m...@gmail.com> wrote: > > Hi, > ... > +1 to the idea. Here are some minor comments: > > @@ -1667,7 +1658,7 @@ ReorderBufferTruncateTXN(ReorderBuffer *rb, > ReorderBufferTXN *txn, bool txn_prep > * about the toplevel xact (we send the XID in all messages), but we never > * stream XIDs of empty subxacts. > */ > - if ((!txn_prepared) && ((!txn->toptxn) || (txn->nentries_mem != 0))) > + if ((!txn_prepared) && (rbtxn_is_toptxn(txn) || (txn->nentries_mem != 0))) > txn->txn_flags |= RBTXN_IS_STREAMED; > > Probably the following comment of the above lines also needs to be updated? > > * The toplevel transaction, identified by (toptxn==NULL), is marked as > * streamed always, > > --- > +/* Is this a top-level transaction? */ > +#define rbtxn_is_toptxn(txn)\ > +(\ > + (txn)->toptxn == NULL\ > +) > + > +/* Is this a subtransaction? */ > +#define rbtxn_is_subtxn(txn)\ > +(\ > + (txn)->toptxn != NULL\ > +) > + > +/* Get the top-level transaction of this (sub)transaction. */ > +#define rbtxn_get_toptxn(txn)\ > +(\ > + rbtxn_is_subtxn(txn) ? (txn)->toptxn : (txn)\ > +) > > We need a whitespace before backslashes. >
Thanks for your interest in my patch. PSA v4 which addresses both of your review comments. ------ Kind Regards, Peter Smith. Fujitsu Australia
v4-0001-Add-macros-for-ReorderBufferTXN-toptxn.patch
Description: Binary data