Re: Add last commit LSN to pg_last_committed_xact()

From: Andres Freund <andres(at)anarazel(dot)de>
To: James Coleman <jtc331(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add last commit LSN to pg_last_committed_xact()
Date: 2022-01-20 03:12:26
Message-ID: 20220120031226.akmlrhedb5ns2eip@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-01-20 03:29:19 Re: row filtering for logical replication
Previous Message Michael Paquier 2022-01-20 03:01:29 Re: pg_upgrade should truncate/remove its logs before running