Re: Add macros for ReorderBufferTXN toptxn
От | Peter Smith |
---|---|
Тема | Re: Add macros for ReorderBufferTXN toptxn |
Дата | |
Msg-id | CAHut+PsDvFvwBiSzB0bCZgMwDUfOD4dackL0ZcTHXtLuewdobA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Add macros for ReorderBufferTXN toptxn (Masahiko Sawada <sawada.mshk@gmail.com>) |
Ответы |
Re: Add macros for ReorderBufferTXN toptxn
Re: Add macros for ReorderBufferTXN toptxn |
Список | pgsql-hackers |
On Wed, Mar 15, 2023 at 4:55 PM Masahiko Sawada <sawada.mshk@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
Вложения
В списке pgsql-hackers по дате отправления: