Re: pg_waldump and PREPARE

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_waldump and PREPARE
Date: 2019-04-25 16:04:42
Message-ID: 20190425160442.GA1822@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-Apr-26, Fujii Masao wrote:

> Hi,
>
> pg_waldump report no detail information about PREPARE TRANSACTION record,
> as follows.
>
> rmgr: Transaction len (rec/tot): 250/ 250, tx: 485,
> lsn: 0/020000A8, prev 0/02000060, desc: PREPARE
>
> I'd like to modify pg_waldump, i.e., xact_desc(), so that it reports
> detail information like GID, as follows. Attached patch does that.
> This would be helpful, for example, when diagnosing 2PC-related
> trouble by checking the status of 2PC transaction with the specified GID.
> Thought?
>
> rmgr: Transaction len (rec/tot): 250/ 250, tx: 485,
> lsn: 0/020000A8, prev 0/02000060, desc: PREPARE gid abc: 2004-06-17
> 05:26:27.500240 JST

I think this is a great change to make.

Strangely, before your patch, ParsePrepareRecord seems completely
unused.

I'm not sure I like the moving of that routine to xactdesc.c ...
on one hand, it would be side-by-side with ParseCommitRecord, but OTOH
it seems weird to have twophase.c call xactdesc.c. I also wonder if
defining the structs in the way you do is the most sensible arrangement.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashwin Agrawal 2019-04-25 16:19:41 Re: Calling PrepareTempTablespaces in BufFileCreateTemp
Previous Message Jeff Janes 2019-04-25 15:53:16 Re: TRACE_SORT defined by default