Re: pg_receivewal and messages printed in non-verbose mode

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Craig Ringer <craig(at)2ndquadrant(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_receivewal and messages printed in non-verbose mode
Date: 2017-07-10 02:08:10
Message-ID: CAB7nPqRD7+qBLX-dgWZ0GTCdUtLu1j37858GemnNGYpvMDR20A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jul 9, 2017 at 9:30 PM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> On Sun, Jul 9, 2017 at 5:58 AM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
>> I wonder if we should actually just remove the second message? AFAICT no
>> other tools log that information. Is there any particular reason why we want
>> that logging in pg_receivewal when we don't have it in other tools?
>
> I maintain a fork of pg_receivewal lately that works as a service, and
> I have found myself a fan of this log bit when debugging funky issues.
> That's a personal opinion, no objections to remove it either.

The patch I sent upthread was actually doing that, which is obviously incorrect:
- if (time_to_abort)
+ if (verbose && time_to_abort)
{
fprintf(stderr, _("%s: received interrupt signal, exiting\n"),
progname);

While the version on my laptop does that:
if (time_to_abort)
{
- fprintf(stderr, _("%s: received interrupt signal, exiting\n"),
- progname);
+ if (verbose)
+ fprintf(stderr, _("%s: received interrupt
signal, exiting\n"),
+ progname);
return true;
}
return false;
Not sure how that feel into the cracks.

I slept on it, and let's do things the same way as the other tools do
without logs in this case. So this gives the patch attached.
--
Michael

Attachment Content-Type Size
receivewal-verbose-fix-v2.patch application/octet-stream 1.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-07-10 02:56:36 Re: pg_stop_backup(wait_for_archive := true) on standby server
Previous Message Masahiko Sawada 2017-07-10 01:23:10 Re: replication_slot_catalog_xmin not explicitly initialized when creating procArray