Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1frwKt-00068C-1y for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Aug 2018 02:23:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1frwKo-0000im-Ro for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Aug 2018 02:23:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1frwKo-0000if-Lv for pgsql-bugs@lists.postgresql.org; Tue, 21 Aug 2018 02:23:54 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1frwKk-0007DJ-Ne for pgsql-bugs@postgresql.org; Tue, 21 Aug 2018 02:23:54 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 40BB22FC; Mon, 20 Aug 2018 22:23:48 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 20 Aug 2018 22:23:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=x4pETzW3MsrAKK5LmBn5LBgXHIlbTmAJmZ+ns6feWwg=; b=4h0WmYyZ b9ww98YhUXOBl4mCyTABkFVSk8nkYUb6pRm7/UwwM8rkV7IDZOHh1fYN/itNKVus CUQBo6wR7rgGhlX8afrONxZsEtBKcG9EmcVgK+2Qxrdu5vq1RufkPdyDrsj+o5jW G5tNmze9EX1OlbzVUwXoQO4aU+mb1jTTrnAx0LvqawTc7l+IaAjiwtffwd8YwiHJ NjN5lDzuHmx3mUfzu7xg7JIW+6uiQWi3KRGQz0Stx+Pji7JHb1/IMNcsxi3wrFte 2M119k5uDKR6SmFPaoHj69j+aoAPKTd4fqjmEjCYhnaGlpUtgjiQk4MzfO7OQuqY zc0Dws6bortk6w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=x4pETzW3MsrAKK5LmBn5LBgXHIlbT mAJmZ+ns6feWwg=; b=jMSBMzFvip8yqLnSCHaUJOgfOPmA7ivo9Bs93jtetweYI 78pQ+apWs5IgFAHFikdeYmV+yBfFvYyZHEI+jzf/cA1BChMJ6TNfdluJ6D8pvPqm g0jZNVZfQl/nFOURHuxqR+aZp3O7wdDAiegkr16+LhWNWRw0SnWqOJv9WKrEe6rJ xa6ahhgNOHCjJAxwEZZNS512WZWhZ4/BtaMLuWy3/GtGjGt8vYsaciTRSlyZi8OV xU0nKJfcNiOl6HpcD5BvEUUjVYPlseIxVzzUhMdFjXkCqaKR5N9PQVTg7L/UHkoI j6jTRGZe7z9BKsiYAhSMYJ+sENDcRea4DkKdA+Njg== X-ME-Proxy: X-ME-Sender: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 9266110288; Mon, 20 Aug 2018 22:23:45 -0400 (EDT) Date: Tue, 21 Aug 2018 11:23:42 +0900 From: Michael Paquier To: Alexander Kukushkin Cc: pgsql-bugs@postgresql.org, 9erthalion6@gmail.com Subject: Re: csvlog gets crazy when csv file is not writable Message-ID: <20180821022342.GD2897@paquier.xyz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cPi+lWm09sJ+d57q" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --cPi+lWm09sJ+d57q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 20, 2018 at 03:55:01PM +0200, Alexander Kukushkin wrote: > If for some reason postgres can't open 'postgresql-%Y-%m-%d.csv' file > for writing, it gets mad and outputs a few thousands of lines to > stderr: > > 2018-08-20 15:40:46.920 CEST [22069] PANIC: could not open log file Ah, this log message could be changed to be simply "could not open file", the file name offers enough context... > And so on. ERRORDATA_STACK_SIZE is presented in the output 3963 times >=20 > Sure, it is entirely my fault, that csv file is not writable, but such > avalanche of PANIC lines is really scary. Yeah, this is a recursion in logfile_open -> open_csvlogfile. With stderr there is a much better effort, where the server just quits with a FATAL if the log file cannot be opened in SysLogger_Start. Could this be an argument for allowing logfile_open() to use write_stderr? I am not sure under the hood of the don't-do-that rule. And we make sure that log_destination is writable already at early stage, which would cover any scenarios like a kernel switching the log partition to be read-only. -- Michael --cPi+lWm09sJ+d57q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlt7d64ACgkQnvQgOdby QH0FQQ//UwAJK7npSPUVZJE0xhOzAi+KO1ka5kvwKDNT7eeC5knr98c3l/ehISBk 99X5idggdigU3bloxoV6QIkj6O5hYEd4xbr1Y4Azlt68DKNv+1SqTsCCL9iXlM86 nTLfbEmCFl2SQzj6Vx/sI08aPzAxeztZEV6txdxGfL5i5xoWOGRBzCEt+5DAOkRg DsUv3g9KFMVPEr0wx2VzaoNG4mrJfSNAUH97upwaWbfRxRnrhG/eYQ9S+j51h005 4FFOrr4Z8swAMreEmtf58K0uW0tuVlvYkqbqL0sMP3nehvVT01KlsR0+fQwv+NSy pjuv/0OTRuM1Lax3sr8xy+OesqtFdKzJs9JXULeMOLp944YnN1uppf8kilTZBDrl HfmHVDrMOB02cvnxHI0SN5NVylEzCbNHkxeHvjkykIyLXqwAPw4qeopbV8QNkJvW +7LrBQXjlnpsaovK6ANLVo7CTeHsyQWnENWg4+i+pfwPIahhLKG7FcE7PpY8gYl5 Hn8hiIo+sbePbO1H3wvkLQRLD6AEbO1FFyrqyH/drnYw3zrXiK7nUsjhnOqgQxbe vdnz64oLg9VIczteK88jr54J9IM5CuLT/Uapwjf7TkPMc3RwKKNxIhJvzz4/jfE4 zG/Qlc/k9sOHJisVFZdWmemZOcTxWB4kM+OHx8p1BO+JN8gWXNE= =nASH -----END PGP SIGNATURE----- --cPi+lWm09sJ+d57q--