log_destination reload/restart doesn't stop file creation

From: Thom Brown <thom(at)linux(dot)com>
To: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: log_destination reload/restart doesn't stop file creation
Date: 2018-08-14 12:32:25
Message-ID: CAA-aLv4=TR+xcCZvtbHUh02804-z3L1GjG+yyP3=1DP_Ahs7zg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

I've tested the following on git head. When changing log_destination
and reloading, the old destination file continues to be made, just not
populated with anything. That means at every file rotation, 2 files
are created.

For example:

log_destination = 'stderr'

I get this in my log directory:

postgresql-2018-08-14_131640.log

If I change it to csvlog and reload, I end up with:

0 -rw------- 1 thom thom 0 Aug 14 13:19 postgresql-2018-08-14_131900.log
4 -rw------- 1 thom thom 194 Aug 14 13:19 postgresql-2018-08-14_131900.csv

So I get the csv file, but it's still producing the .log file which
remains 0 bytes. The same happens in reverse. (i.e. I end up with an
empty .csv file and a populated .log file).

I expect the old file to stop being created.

What's also interesting is if I have log_destination set to 'csvlog',
then I restart, or stop then start the database manually, I still get
2 files, which contain:

postgresql-2018-08-14_132510.log:
2018-08-14 13:25:10 BST [21065]: [6-1] user=,db=,client= LOG: ending
log output to stderr
2018-08-14 13:25:10 BST [21065]: [7-1] user=,db=,client= HINT: Future
log output will go to log destination "csvlog".

postgresql-2018-08-14_132510.csv:
2018-08-14 13:25:10.626 BST,,,21065,,5b72ca26.5249,1,,2018-08-14
13:25:10 BST,,0,LOG,00000,"ending log output to stderr",,"Future log
output will go to log destination ""csvlog"".",,,,,,,""
2018-08-14 13:25:10.675 BST,,,21067,,5b72ca26.524b,1,,2018-08-14
13:25:10 BST,,0,LOG,00000,"database system was shut down at 2018-08-14
13:25:08 BST",,,,,,,,,""
2018-08-14 13:25:10.868 BST,,,21065,,5b72ca26.5249,2,,2018-08-14
13:25:10 BST,,0,LOG,00000,"database system is ready to accept
connections",,,,,,,,,""

Then I continue to get empty .log files:
0 -rw------- 1 thom thom 0 Aug 14 13:26 postgresql-2018-08-14_132600.log
0 -rw------- 1 thom thom 0 Aug 14 13:26 postgresql-2018-08-14_132600.csv
0 -rw------- 1 thom thom 0 Aug 14 13:27 postgresql-2018-08-14_132700.log
0 -rw------- 1 thom thom 0 Aug 14 13:27 postgresql-2018-08-14_132700.csv
0 -rw------- 1 thom thom 0 Aug 14 13:28 postgresql-2018-08-14_132800.log
4 -rw------- 1 thom thom 195 Aug 14 13:28 postgresql-2018-08-14_132800.csv
0 -rw------- 1 thom thom 0 Aug 14 13:29 postgresql-2018-08-14_132900.log
0 -rw------- 1 thom thom 0 Aug 14 13:29 postgresql-2018-08-14_132900.csv

This doesn't happen if log_destination is set to 'stderr'.

Regards

Thom

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Hemanth Kumar 2018-08-14 12:45:42 Re: Issue
Previous Message Marko Tiikkaja 2018-08-14 12:20:41 Re: BUG #15324: Non-deterministic behaviour from parallelised sub-query