Re: [PATCH] add relation and block-level filtering to pg_waldump

From: Japin Li <japinli(at)hotmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: David Christensen <david(dot)christensen(at)crunchydata(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] add relation and block-level filtering to pg_waldump
Date: 2022-03-25 01:32:49
Message-ID: MEYP282MB16698466E671832348807445B61A9@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Fri, 25 Mar 2022 at 08:55, Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> On Fri, Mar 25, 2022 at 1:43 PM Japin Li <japinli(at)hotmail(dot)com> wrote:
>> + printf(_(" -x, --xid=XID only show records with transaction ID XID\n"));
>>
>> I think the description of transaction ID is enough, IIUC, XID is use in core,
>> which means transaction ID.
>
> The mention of "XID" corresponds to XID on the left, like a sort of
> variable. That text is not changed by this patch.
>
>> See: src/bin/pg_resetwal/pg_resetwal.c
>>
>> 1239 printf(_(" -V, --version output version information, then exit\n"));
>> 1240 printf(_(" -x, --next-transaction-id=XID set next transaction ID\n"));
>
> Hmm, yeah that is inconsistent, but it seems like it is pg_resetwal.c
> that is not following the notational convention there. Other things
> in pg_resetwal's --help use that 'variable' style.
>

Thanks for your explanation!

>> + if (sscanf(optarg, "%u/%u/%u",
>> + &config.filter_by_relation.spcNode,
>> + &config.filter_by_relation.dbNode,
>> + &config.filter_by_relation.relNode) != 3 ||
>> + !OidIsValid(config.filter_by_relation.spcNode) ||
>> + !OidIsValid(config.filter_by_relation.relNode))
>>
>> It seems we should also check the dbNode.
>
> This was discussed earlier: it's OK for the dbNode to be invalid (0),
> because that's how shared relations like pg_database are referenced.
> Like this:
>
> $ pg_waldump pgdata/pg_wal/000000010000000000000001 --relation
> 1664/0/1262 --fork vm --limit 1
> rmgr: Heap2 len (rec/tot): 64/ 8256, tx: 0, lsn:
> 0/01491F20, prev 0/01491EC0, desc: VISIBLE cutoff xid 1 flags 0x03,
> blkref #0: rel 1664/0/1262 fork vm blk 0 FPW, blkref #1: rel
> 1664/0/1262 blk 0
>

Oh, my bad, I missed the discussion email. Sorry for the noise.

--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2022-03-25 01:45:54 Re: Remove an unnecessary errmsg_plural in dependency.c
Previous Message Tatsuo Ishii 2022-03-25 01:25:20 Re: [HACKERS] WIP aPatch: Pgbench Serialization and deadlock errors