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-08 07:31:42
Message-ID: YbBfXpo8/O4B7dto@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 06, 2021 at 11:24:09PM +0900, Masahiko Sawada wrote:
> On Mon, Dec 6, 2021 at 5:09 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>> Shouldn't you check for parsed.origin_lsn instead? The replication
>> origin is stored there as far as I read EndPrepare().
>
> Also, looking at PrepareRedoAdd(), we check the replication origin id.
> So I think that it'd be better to check origin_id for consistency.

Okay, this consistency would make sense, then. Perhaps some comments
should be added to tell that?

>> 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?
>
> Good catch! I'll submit an updated patch.

Thanks!
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2021-12-08 07:35:15 Re: Is it correct to update db state in control file as "shutting down" during end-of-recovery checkpoint?
Previous Message Michael Paquier 2021-12-08 07:21:55 Re: add recovery, backup, archive, streaming etc. activity messages to server logs along with ps display