Confusing recovery message when target not hit - Mailing list pgsql-hackers

From Thom Brown
Subject Confusing recovery message when target not hit
Date
Msg-id CAA-aLv4K2-9a+cvK75dkZkYD1etxpaH+9HC0vm9Ebw2up9Co2A@mail.gmail.com
Whole thread Raw
Responses Re: Confusing recovery message when target not hit  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
Hi all,

When recovery_target_time is set, but recovery finishes before it reaches that time, it outputs "before 2000-01-01 00:00:00+00" to the .history file.  This is because it uses recoveryStopTime, which is initialised to 0, but is never set, and is then passed to timestamptz_to_str, which gives it this date output.

A similar problem exists for recovery_target_xid.  When recovery finishes before reaching the specified xid, it outputs "before transaction 0" to the .history file, which is also confusing.

Could we produce something more meaningful?  I've attached a patch which changes it to say 'recovery reached consistency before recovery target time of "<recovery_target_time>"' and 'recovery reached consistency before recovery target xid of "<recovery_target_xid>"'.

It may be the wrong way of going about it, but you get the idea of what I'm suggesting we output instead.

Thom
Attachment

pgsql-hackers by date:

Previous
From: "'bruce@momjian.us'"
Date:
Subject: Re: Prepared statements and generic plans
Next
From: Amit Kapila
Date:
Subject: Re: [COMMITTERS] pgsql: Don't generate parallel paths for rels with parallel-restricted