Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lISb3-0007Nb-Bw for pgsql-general@arkaria.postgresql.org; Sat, 06 Mar 2021 08:47:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lISb2-0006C3-AX for pgsql-general@arkaria.postgresql.org; Sat, 06 Mar 2021 08:47:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lISb1-0006Bv-Uj for pgsql-general@lists.postgresql.org; Sat, 06 Mar 2021 08:47:36 +0000 Received: from portal-smtp-out.hot.ee ([194.126.101.125]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lISay-0007HU-M7 for pgsql-general@postgresql.org; Sat, 06 Mar 2021 08:47:34 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 803C21B24; Sat, 6 Mar 2021 10:47:28 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at vm-hot-relay10.estpak.ee Received: from portal-smtp-out.hot.ee ([127.0.0.1]) by localhost (vm-hot-relay10.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fb1Vi17Rok9j; Sat, 6 Mar 2021 10:47:08 +0200 (EET) Received: from mail.hot.ee (hot-relayhost2.estpak.ee [213.180.2.80]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id E50211B82; Sat, 6 Mar 2021 10:47:08 +0200 (EET) Subject: Re: Log files polluted with permission denied error messages after every 10 seconds To: Michael Paquier Cc: Laurenz Albe , pgsql-general References: <3861ff1e-0923-7838-e826-094cc9bef737@hot.ee> <676dc946300076e60d6af455ac1bfa489fbbdd8b.camel@cybertec.at> <97e00b3b-9357-4386-d4bd-b9128e4b8924@hot.ee> From: Andrus Message-ID: <2a566632-8822-dc3c-e209-b1d7f7f06027@hot.ee> Date: Sat, 6 Mar 2021 10:47:00 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------3322455BBFF3033FF2C0BB8B" Content-Language: et List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------3322455BBFF3033FF2C0BB8B Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Hi! > On which files are those complaints? log contains file names: ... 2021-03-06 10:27:51.468 EET [4580] LOG:  could not rename file "pg_wal/000000010000000600000092": Permission denied 2021-03-06 10:28:01.526 EET [4580] LOG:  could not rename file "pg_wal/000000010000000600000098": Permission denied 2021-03-06 10:28:11.582 EET [4580] LOG:  could not rename file "pg_wal/000000010000000600000099": Permission denied 2021-03-06 10:28:21.637 EET [4580] LOG:  could not rename file "pg_wal/0000000100000006000000E8": Permission denied 2021-03-06 10:28:31.692 EET [4580] LOG:  could not rename file "pg_wal/0000000100000006000000EA": Permission denied 2021-03-06 10:28:41.750 EET [4580] LOG:  could not rename file "pg_wal/0000000100000006000000EB": Permission denied 2021-03-06 10:28:51.807 EET [4580] LOG:  could not rename file "pg_wal/0000000100000006000000EC": Permission denied 2021-03-06 10:29:01.864 EET [4580] LOG:  could not rename file "pg_wal/0000000100000006000000ED": Permission denied 2021-03-06 10:29:11.920 EET [4580] LOG:  could not rename file "pg_wal/0000000100000006000000EE": Permission denied 2021-03-06 10:29:21.976 EET [4580] LOG:  could not rename file "pg_wal/0000000100000006000000EF": Permission denied 2021-03-06 10:29:32.033 EET [4580] LOG:  could not rename file "pg_wal/0000000100000006000000F0": Permission denied Server was installed some days ago. Numbers in end of file names are small. So it looks like almost every wal file in timeline causes entry. > It seems to me that you may have > more going on in this system that interacts with your data folder than > you think. There is Windows server backup utility client from https://www.r1soft.com/  . It looks like it performs block-level realtime backup of HDD . Its about box shows last year 2015 , but Windows Server 2019 is used. Maybe it is outdated and causes the issue. It is maintained by by ISP and I cannot stop it easily. I havent found an option in its config to susped or configure it. Config contains max_wal_size = 1GB There are 67 files in pg_wal. Earlier have have similar errors in my app if windows temporary directory contains  200000 files by mistake. Cleaning temp directory and adding random number to temporary file names seems to fix this. Should max_wal or or other param size decrased or increased to avoid file access conflict. > pg_wal also contains files with .deleted extension like >> 0000000100000005000000B2.deleted > These are generated on Windows when removing a past WAL segment, where > the process involves a rename followed by durable_unlink() that would > generate some LOG entries in the logs if the internal unlink() failed > (see RemoveXlogFile() in xlog.c). .deleted files have dates ealier dates (yesterday and 4th or March). Almost all regular wal files have todays date. There are about 30 .deleted files from totel 67 files in pg_wal. Will postgres remove .deleted files automatically or should I create windows task which deletes them periodically ? Andrus. --------------3322455BBFF3033FF2C0BB8B Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit

Hi!

> On which files are those complaints?

log contains file names:

...

2021-03-06 10:27:51.468 EET [4580] LOG:  could not rename file "pg_wal/000000010000000600000092": Permission denied
2021-03-06 10:28:01.526 EET [4580] LOG:  could not rename file "pg_wal/000000010000000600000098": Permission denied
2021-03-06 10:28:11.582 EET [4580] LOG:  could not rename file "pg_wal/000000010000000600000099": Permission denied
2021-03-06 10:28:21.637 EET [4580] LOG:  could not rename file "pg_wal/0000000100000006000000E8": Permission denied
2021-03-06 10:28:31.692 EET [4580] LOG:  could not rename file "pg_wal/0000000100000006000000EA": Permission denied
2021-03-06 10:28:41.750 EET [4580] LOG:  could not rename file "pg_wal/0000000100000006000000EB": Permission denied
2021-03-06 10:28:51.807 EET [4580] LOG:  could not rename file "pg_wal/0000000100000006000000EC": Permission denied
2021-03-06 10:29:01.864 EET [4580] LOG:  could not rename file "pg_wal/0000000100000006000000ED": Permission denied
2021-03-06 10:29:11.920 EET [4580] LOG:  could not rename file "pg_wal/0000000100000006000000EE": Permission denied
2021-03-06 10:29:21.976 EET [4580] LOG:  could not rename file "pg_wal/0000000100000006000000EF": Permission denied
2021-03-06 10:29:32.033 EET [4580] LOG:  could not rename file "pg_wal/0000000100000006000000F0": Permission denied

Server was installed some days ago. Numbers in end of file names are small. So it looks like almost every wal file in timeline causes entry.

It seems to me that you may have
more going on in this system that interacts with your data folder than
you think.

There is Windows server backup utility client from https://www.r1soft.com/  . It looks like it performs block-level realtime backup of HDD .

Its about box shows last year 2015 , but Windows Server 2019 is used. Maybe it is outdated and causes the issue. It is maintained by by ISP and I cannot stop it easily.

I havent found an option in its config to susped or configure it.

Config contains

max_wal_size = 1GB

There are 67 files in pg_wal. Earlier have have similar errors in my app if windows temporary directory contains  200000 files by mistake. Cleaning temp directory and adding random number to temporary file names seems to fix this.

Should max_wal or or other param size decrased or increased to avoid file access conflict.


pg_wal also contains files with .deleted extension like
0000000100000005000000B2.deleted
These are generated on Windows when removing a past WAL segment, where
the process involves a rename followed by durable_unlink() that would
generate some LOG entries in the logs if the internal unlink() failed
(see RemoveXlogFile() in xlog.c). 

.deleted files have dates ealier dates (yesterday and 4th or March). Almost all regular wal files have todays date.

There are about 30 .deleted files from totel 67 files in pg_wal. Will postgres remove .deleted files automatically or should I create windows task which deletes them periodically ?

Andrus.


--------------3322455BBFF3033FF2C0BB8B--