Re: pgsql: Document XLOG_INCLUDE_XID a little better

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Document XLOG_INCLUDE_XID a little better
Date: 2021-10-20 04:55:05
Message-ID: CAFiTN-saZuSm4hLQTG81vWf4Tb+9U6vAXpJcmNh+VDC0i1v5Kg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Mon, Oct 18, 2021 at 10:48 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:

>
> Today, I have looked at this patch again and slightly changed a
> comment, one of the function name and variable name. Do, let me know
> if you or others have any suggestions for better names or otherwise? I
> think we should backpatch this to 14 as well where this code was
> introduced.
>

bool
-IsSubTransactionAssignmentPending(void)
+IsTopTransactionIdLogged(void)
{
/* wal_level has to be logical */
if (!XLogLogicalInfoActive())
@@ -6131,19 +6131,20 @@ IsSubTransactionAssignmentPending(void)
if (!TransactionIdIsValid(GetCurrentTransactionIdIfAny()))
return false;

- /* and it should not be already 'assigned' */
- return !CurrentTransactionState->assigned;
+ /* and it should not be already 'logged' */
+ return !CurrentTransactionState->topXidLogged;
}

I have one comment here, basically, you have changed the function name
to "IsTopTransactionIdLogged", but it still behaves like
IsTopTransactionIdLogPending. Now with the new name, it should return
(CurrentTransactionState->topXidLogged) instead of
(!CurrentTransactionState->topXidLogged).

And the caller should also be changed accordingly. Other changes look fine.

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2021-10-20 07:50:11 pgsql: Fix build of MSVC with OpenSSL 3.0.0
Previous Message Alvaro Herrera 2021-10-19 22:11:24 pgsql: Ensure correct lock level is used in ALTER ... RENAME

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiro Ikeda 2021-10-20 05:12:20 LogicalChanges* and LogicalSubxact* wait events are never reported
Previous Message Michael Paquier 2021-10-20 03:47:04 Re: BUG #17220: ALTER INDEX ALTER COLUMN SET (..) with an optionless opclass makes index and table unusable