Re: pg_ctl emits strange warning message - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: pg_ctl emits strange warning message
Date
Msg-id 4C8E209C.1090605@enterprisedb.com
Whole thread Raw
In response to pg_ctl emits strange warning message  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: pg_ctl emits strange warning message  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On 13/09/10 13:08, Fujii Masao wrote:
> 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.

There's this comment by Robert Haas:

http://archives.postgresql.org/pgsql-hackers/2010-05/msg01433.php

Like Robert, I'm also a bit worried that this might make the message 
less prominent. When you run "pg_ctl stop" manually, it's good to get 
the message directly in the terminal.

Another line of attack is to remove the backup_label file earlier during 
recovery. We could remove it as soon as we update pg_control file with 
the same information, ie. the backup start location. And by remove I 
mean rename to backup_label.old, to avoid destroying forensic 
information ;-).

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: security label support, revised
Next
From: Hitoshi Harada
Date:
Subject: top-level DML under CTEs