Re: pgsql: Document XLOG_INCLUDE_XID a little better - Mailing list pgsql-hackers

From Dilip Kumar
Subject Re: pgsql: Document XLOG_INCLUDE_XID a little better
Date
Msg-id CAFiTN-saZuSm4hLQTG81vWf4Tb+9U6vAXpJcmNh+VDC0i1v5Kg@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Document XLOG_INCLUDE_XID a little better  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: pgsql: Document XLOG_INCLUDE_XID a little better  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Mon, Oct 18, 2021 at 10:48 AM Amit Kapila <amit.kapila16@gmail.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



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #17220: ALTER INDEX ALTER COLUMN SET (..) with an optionless opclass makes index and table unusable
Next
From: Masahiro Ikeda
Date:
Subject: LogicalChanges* and LogicalSubxact* wait events are never reported