Re: Make mesage at end-of-recovery less scary.

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: pashkin(dot)elfe(at)gmail(dot)com
Cc: michael(at)paquier(dot)xyz, bossartn(at)amazon(dot)com, david(at)pgmasters(dot)net, peter(dot)eisentraut(at)2ndquadrant(dot)com, andres(at)anarazel(dot)de, pgsql-hackers(at)lists(dot)postgresql(dot)org, jtc331(at)gmail(dot)com, robertmhaas(at)gmail(dot)com
Subject: Re: Make mesage at end-of-recovery less scary.
Date: 2022-02-02 05:34:58
Message-ID: 20220202.143458.630414785285596858.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Tue, 1 Feb 2022 12:38:01 +0400, Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com> wrote in
> Maybe it can be written little bit shorter:
> pe = (char *) record + XLOG_BLCKSZ - (RecPtr & (XLOG_BLCKSZ - 1));
> as
> pe = p + XLOG_BLCKSZ - (RecPtr & (XLOG_BLCKSZ - 1));
> ?

That difference would be a matter of taste, but I found it looks
cleaner that definition and assignment is separated for both p and pe.
Now it is like the following.

> char *p;
> char *pe;
>
> /* scan from the beginning of the record to the end of block */
> p = (char *) record;
> pe = p + XLOG_BLCKSZ - (RecPtr & (XLOG_BLCKSZ - 1));

> The problem that pgindent sometimes reflow formatting of unrelated blocks
> is indeed existing. But I think it's right to manually leave pgindent-ed
> code only on what is related to the patch. The leftover is pgindent-ed in a
> scheduled manner sometimes, so don't need to bother.

Yeah, I meant that it is a bit annoying to unpginden-ting unrelated
edits:p

> I'd like to set v10 as RfC.

Thanks! The suggested change is done in the attached v11.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
v11-0001-Make-End-Of-Recovery-error-less-scary.patch text/x-patch 15.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2022-02-02 05:55:56 Re: XLogReadRecord() error in XlogReadTwoPhaseData()
Previous Message David G. Johnston 2022-02-02 04:11:40 Re: Design of pg_stat_subscription_workers vs pgstats