Re: pgsql: Document XLOG_INCLUDE_XID a little better

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, Amit Kapila <amit.kapila16@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-10-04T17:13:20Z
Lists: pgsql-hackers
On Sat, Oct 2, 2021 at 6:46 AM Dilip Kumar <dilipbalaut@gmail.com> wrote:
> I have written two patches, Approach1 is as you described using a
> static boolean and Approach2 as a local variable to XLogAssembleRecord
> as described by Amit, attached both of them for your reference.
> IMHO, either of these approaches looks cleaner.

I agree, and I don't have a strong preference between them. If I were
writing code like this from scratch, I would do what 0001 does. But
0002 is arguably more consistent with the existing style. It's kind of
hard to judge, at least for me, which is to be preferred.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



Commits

  1. Move MarkCurrentTransactionIdLoggedIfAny() out of the critical section.

  2. Replace XLOG_INCLUDE_XID flag with a more localized flag.

  3. Document XLOG_INCLUDE_XID a little better

  4. Immediately WAL-log subtransaction and top-level XID association.