Re: Add macros for ReorderBufferTXN toptxn
От
Bharath Rupireddy
Тема
Re: Add macros for ReorderBufferTXN toptxn
Дата
Msg-id
CALj2ACUUEXUaF8PeVMNWei=C9W3p7etiGxCFV_mmOtm0KmcF_w@mail.gmail.com
Ответ на
Re: Add macros for ReorderBufferTXN toptxn (Peter Smith)
Список
Дерево обсуждения
Add macros for ReorderBufferTXN toptxn Peter Smith <smithpb2250@gmail.com>
Re: Add macros for ReorderBufferTXN toptxn Amit Kapila <amit.kapila16@gmail.com>
Re: Add macros for ReorderBufferTXN toptxn vignesh C <vignesh21@gmail.com>
Re: Add macros for ReorderBufferTXN toptxn Peter Smith <smithpb2250@gmail.com>
Re: Add macros for ReorderBufferTXN toptxn Amit Kapila <amit.kapila16@gmail.com>
Re: Add macros for ReorderBufferTXN toptxn Peter Smith <smithpb2250@gmail.com>
Re: Add macros for ReorderBufferTXN toptxn Masahiko Sawada <sawada.mshk@gmail.com>
Re: Add macros for ReorderBufferTXN toptxn Peter Smith <smithpb2250@gmail.com>
Re: Add macros for ReorderBufferTXN toptxn Amit Kapila <amit.kapila16@gmail.com>
Re: Add macros for ReorderBufferTXN toptxn Peter Smith <smithpb2250@gmail.com>
Re: Add macros for ReorderBufferTXN toptxn Peter Smith <smithpb2250@gmail.com>
Re: Add macros for ReorderBufferTXN toptxn Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Add macros for ReorderBufferTXN toptxn Amit Kapila <amit.kapila16@gmail.com>
Re: Add macros for ReorderBufferTXN toptxn vignesh C <vignesh21@gmail.com>
Re: Add macros for ReorderBufferTXN toptxn Amit Kapila <amit.kapila16@gmail.com>
Re: Add macros for ReorderBufferTXN toptxn Peter Smith <smithpb2250@gmail.com>
On Thu, Mar 16, 2023 at 7:20 AM Peter Smith wrote:
>
> PSA v4 which addresses both of your review comments.
Looks like a reasonable change to me.
A nitpick: how about using rbtxn_get_toptxn instead of an explicit
variable toptxn for single use?
1.
Change
ReorderBufferTXN *toptxn = rbtxn_get_toptxn(txn);
TestDecodingTxnData *txndata = toptxn->output_plugin_private;
To
TestDecodingTxnData *txndata = rbtxn_get_toptxn(txn)->output_plugin_private;
2.
Change
ReorderBufferTXN *toptxn = rbtxn_get_toptxn(txn);
toptxn->txn_flags |= RBTXN_HAS_STREAMABLE_CHANGE;
To
rbtxn_get_toptxn(txn)->txn_flags |= RBTXN_HAS_STREAMABLE_CHANGE;
3.
Change
/*
* Update the total size in top level as well. This is later used to
* compute the decoding stats.
*/
toptxn = rbtxn_get_toptxn(txn);
if (addition)
{
txn->size += sz;
rb->size += sz;
/* Update the total size in the top transaction. */
toptxn->total_size += sz;
}
else
{
Assert((rb->size >= sz) && (txn->size >= sz));
txn->size -= sz;
rb->size -= sz;
/* Update the total size in the top transaction. */
toptxn->total_size -= sz;
}
To
/*
* Update the total size in top level as well. This is later used to
* compute the decoding stats.
*/
if (addition)
{
txn->size += sz;
rb->size += sz;
rbtxn_get_toptxn(txn)->total_size += sz;
}
else
{
Assert((rb->size >= sz) && (txn->size >= sz));
txn->size -= sz;
rb->size -= sz;
rbtxn_get_toptxn(txn)->total_size -= sz;
}
--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
В списке pgsql-hackers по дате отправления
От: Yura Sokolov
Дата: