pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove the redundant remote_final_lsn variable from the apply wo
Date: Wed, 26 Aug 2026 05:28:46 +0000
Message-ID: <E1wz6Bp-000000029U6-1bT7@gemulon.postgresql.org> (raw)

Remove the redundant remote_final_lsn variable from the apply worker.

The apply worker tracked the final LSN of the remote transaction being
applied in a separate global variable remote_final_lsn, even though
apply_error_callback_arg already tracked the same transaction's xid and
finish LSN for error context reporting, and both were updated together
at the same places.

Rename ApplyErrorCallbackArg to ApplyRemoteCtx and treat its
remote_xid/finish_lsn pair as the generic descriptor of the remote
transaction currently being applied, replacing all uses of
remote_final_lsn so the redundant global can be removed.

There is no behavior change.

Recording the remote transaction being applied in a single place should
also help the proposed conflict log table patch, which needs the same
information when logging a conflict.

Author: Zhijie Hou <houzj.fnst@fujitsu.com>
Author: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Reviewed-by: shveta malik <shveta.malik@gmail.com>
Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
Discussion: https://postgr.es/m/TY4PR01MB177186ED4D38C5356294CC51C94A42@TY4PR01MB17718.jpnprd01.prod.outlook.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2f4df67f5d00836979bc72bf6113adb45aff48df

Modified Files
--------------
.../replication/logical/applyparallelworker.c      |   5 +-
src/backend/replication/logical/worker.c           | 243 ++++++++++++---------
src/tools/pgindent/typedefs.list                   |   2 +-
3 files changed, 141 insertions(+), 109 deletions(-)



Message-ID: <E1wz6Bp-000000029U6-1bT7@gemulon.postgresql.org>
Permalink:  ../E1wz6Bp-000000029U6-1bT7@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wz6Bp-000000029U6-1bT7@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: akapila@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Remove the redundant remote_final_lsn variable from the apply wo
  In-Reply-To: <E1wz6Bp-000000029U6-1bT7@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox