pg_ctl emits strange warning message

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_ctl emits strange warning message
Date: 2010-09-13 10:08:44
Message-ID: AANLkTi=rBTeY4pxHF03KkNQAPPzT1J8RG=j6Ee-XgpMA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

http://archives.postgresql.org/pgsql-hackers/2010-05/msg00921.php
>>> (2)
>>> pg_ctl -ms stop emits the following warning whenever there is the
>>> backup_label file in $PGDATA.
>>>
>>> WARNING: online backup mode is active
>>> Shutdown will not complete until pg_stop_backup() is called.
>>>
>>> This warning doesn't fit in with the shutdown during recovery case.
>>> Since smart shutdown might be requested by other than pg_ctl, the
>>> warning should be emitted in server side rather than client, I think.
>>> How about moving the warning to the server side?
>>
>> Hmm, I'm not sure whether that's a good idea or not. Perhaps we
>> should discuss for 9.1?
>
> Okay, this is not a critical problem.

Let's revisit this issue. The problem here is that pg_ctl might emit
the following warning messages when it shuts down the standby server.
This is very strange thing since online backup mode is never active
in the standby.

WARNING: online backup mode is active
Shutdown will not complete until pg_stop_backup() is called.

Another problem is that the above useful messages are not emitted
when shutdown is requested by other than pg_ctl.

The attached patch moves the warning from pg_ctl to the server side
and makes postmaster emit it only when online backup mode is really
active. This can urge users to call pg_stop_backup to complete smart
shutdown whenever it's requested during online backup. I added the
patch into the next CF.

Comments?

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment Content-Type Size
warning_during_shutdown_v1.patch application/octet-stream 2.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-09-13 11:40:15 Reducing walreceiver latency with a latch
Previous Message Heikki Linnakangas 2010-09-13 09:29:00 Re: Perf regression in 2.6.32 (Ubuntu 10.04 LTS)