Re: Add last commit LSN to pg_last_committed_xact() - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Add last commit LSN to pg_last_committed_xact()
Date
Msg-id 20220120031226.akmlrhedb5ns2eip@alap3.anarazel.de
Whole thread Raw
In response to Re: Add last commit LSN to pg_last_committed_xact()  (James Coleman <jtc331@gmail.com>)
Responses Re: Add last commit LSN to pg_last_committed_xact()
List pgsql-hackers
Hi,

On 2022-01-19 21:23:12 -0500, James Coleman wrote:
>  { oid => '3537', descr => 'get identification of SQL object',
> diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h
> index a58888f9e9..2a026b0844 100644
> --- a/src/include/storage/proc.h
> +++ b/src/include/storage/proc.h
> @@ -258,6 +258,11 @@ struct PGPROC
>      PGPROC       *lockGroupLeader;    /* lock group leader, if I'm a member */
>      dlist_head    lockGroupMembers;    /* list of members, if I'm a leader */
>      dlist_node    lockGroupLink;    /* my member link, if I'm a member */
> +
> +    /*
> +     * Last transaction metadata.
> +     */
> +    XLogRecPtr    lastCommitLSN;        /* cache of last committed LSN */
>  };

Might be worth forcing this to be on a separate cacheline than stuff more
hotly accessed by other backends, like the lock group stuff.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: Null commitTS bug
Next
From: Amit Kapila
Date:
Subject: Re: row filtering for logical replication