Re: Confusing recovery message when target not hit

From: Thom Brown <thom(at)linux(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Confusing recovery message when target not hit
Date: 2016-06-12 10:52:54
Message-ID: CAA-aLv6Lssom=PJBAeUUvrHbvVCbaiLi1c90Cit-97Xj75wFQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11 June 2016 at 13:22, Michael Paquier <michael(dot)paquier(at)gmail(dot)com> wrote:

> On Sat, Jun 11, 2016 at 9:44 AM, Thom Brown <thom(at)linux(dot)com> wrote:
> > It may be the wrong way of going about it, but you get the idea of what
> I'm
> > suggesting we output instead.
>
> Surely things could be better. So +1 to be more verbose here.
>
> + if (recoveryStopTime == 0)
> + snprintf(reason, sizeof(reason),
> + "recovery reached consistency before recovery
> target time of \"%s\"\n",
> + timestamptz_to_str(recoveryTargetTime));
> "Reaching consistency" is not exact for here. I'd rather say "finished
> recovery without reaching target blah"
>

Yeah, sounds fine.

>
> + if (recoveryStopXid == 0)
> Checking for InvalidTransactionId is better here.
>

Agreed.

> And it would be good to initialize recoveryStopTime and
> recoveryStopXid as those are set only when a recovery target is
> reached.
>

Aren't those already set by recoveryStopsBefore()?

Revised patch attached, with new wording and covering recovery target name
case.

Thom

Attachment Content-Type Size
meaningful_premature_recovery_messages_v2.patch application/x-patch 1.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-06-12 11:51:58 Re: Confusing recovery message when target not hit
Previous Message Michael Paquier 2016-06-12 07:34:01 Re: Confusing recovery message when target not hit