Re: Make pg_waldump report replication origin ID, LSN, and timestamp.

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Make pg_waldump report replication origin ID, LSN, and timestamp.
Date: 2021-12-06 08:09:27
Message-ID: Ya3FN1Va88oGFAMG@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 06, 2021 at 04:35:07PM +0900, Masahiko Sawada wrote:
> I've attached a patch to add replication origin information to
> xact_desc_prepare().

Yeah.

+ if (origin_id != InvalidRepOriginId)
+ appendStringInfo(buf, "; origin: node %u, lsn %X/%X, at %s",
+ origin_id,
+ LSN_FORMAT_ARGS(parsed.origin_lsn),
+ timestamptz_to_str(parsed.origin_timestamp));

Shouldn't you check for parsed.origin_lsn instead? The replication
origin is stored there as far as I read EndPrepare().

Commit records check after XACT_XINFO_HAS_ORIGIN, but
xact_desc_abort() may include this information for ROLLBACK PREPARED
transactions so we could use the same logic as xact_desc_commit() for
the abort case, no?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2021-12-06 08:16:59 Re: Shouldn't postgres_fdw report warning when it gives up getting result from foreign server?
Previous Message Masahiko Sawada 2021-12-06 07:35:07 Make pg_waldump report replication origin ID, LSN, and timestamp.