pg_rewind and log messages

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_rewind and log messages
Date: 2015-04-06 03:57:36
Message-ID: CAHGQGwFOSJTbojb7YoRuLHvt8aMM=95tsSicFkREct5Qkz9=pw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I found that pg_rewind has several problems about its log messages.

(1)
It outputs an error message to stdout not stderr.

(2)
The tool name should be added at the head of log message as follows,
but not in pg_rewind.

pg_basebackup: no target directory specified

(3)
> if (datadir_source == NULL && connstr_source == NULL)
> {
> pg_fatal("no source specified (--source-pgdata or --source-server)\n");
> pg_fatal("Try \"%s --help\" for more information.\n", progname);
> exit(1);

Since the first call of pg_fatal exits with 1, the subsequent pg_fatal and exit
will never be called.

(4)
ISTM that set_pglocale_pgservice() needs to be called, but not in pg_rewind.

(5)
printf() is used to output an error in some files, e.g., timeline.c and
parsexlog.c. These printf() should be replaced with pg_log or pg_fatal?

Regards,

--
Fujii Masao

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-04-06 04:41:56 Re: pg_rewind and log messages
Previous Message Alvaro Herrera 2015-04-06 03:53:41 Re: Doubt about AccessExclusiveLock in ALTER TABLE .. SET ( .. );