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 1lMIry-0006H6-UG for pgsql-general@arkaria.postgresql.org; Tue, 16 Mar 2021 23:12:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lMIrx-0005Sx-Tf for pgsql-general@arkaria.postgresql.org; Tue, 16 Mar 2021 23:12:57 +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 1lMIoq-0001aj-Mz for pgsql-general@lists.postgresql.org; Tue, 16 Mar 2021 23:09:44 +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 1lMIon-0006F5-2k for pgsql-general@postgresql.org; Tue, 16 Mar 2021 23:09:43 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 4C29D1D2B; Wed, 17 Mar 2021 01:09:37 +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 5cWXAXVsEzDs; Wed, 17 Mar 2021 01:09:34 +0200 (EET) Received: from mail.hot.ee (hot-relayhost3.estpak.ee [213.180.2.81]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id DB7BF1CD9; Wed, 17 Mar 2021 01:09:34 +0200 (EET) Subject: Re: SV: Log files polluted with permission denied error messages after every 10 seconds To: Michael Paquier Cc: Thomas Munro , Niels Jespersen , Tom Lane , Laurenz Albe , pgsql-general References: <1881481.1615240712@sss.pgh.pa.us> <94330326-5fa0-279a-937c-c4806e1fcd5a@hot.ee> <2586bd2e-77d4-e3e2-2f30-d5c83f52f001@hot.ee> <2b675d25-e86c-ea29-b02e-6bad5d55fbe3@hot.ee> <22ec98b1-cc2f-8e6a-f1d7-ee528237f2fb@hot.ee> <78e6daee-0323-752d-c142-263a80154e18@hot.ee> From: Andrus Message-ID: <6538dfd4-9820-6e30-3eb3-5e035d8aba05@hot.ee> Date: Wed, 17 Mar 2021 01:09:24 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------B0C1FA4E4D741AFF1296BE3C" 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. --------------B0C1FA4E4D741AFF1296BE3C Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Hi! >Those ten seconds are coming from RemoveXlogFile(), where pgrename() > loops 100 times for 100ms before giving up. So something holding up > the file's handle prevents the removal to happen. I tried sysinternals handle pg_wal It shows that only postgres processes have opened files in pg_wal directory: postgres.exe       pid: 11800  type: File           CC0: C:\Program Files\PostgreSQL\13\data\pg_wal\0000000100000012000000B7 postgres.exe       pid: 11800  type: File          12B8: C:\Program Files\PostgreSQL\13\data\pg_wal postgres.exe       pid: 23904  type: File          1134: C:\Program Files\PostgreSQL\13\data\pg_wal\0000000100000012000000B5 postgres.exe       pid: 20908  type: File           17C: C:\Program Files\PostgreSQL\13\data\pg_wal\0000000100000012000000B7 postgres.exe       pid: 29892  type: File           C08: C:\Program Files\PostgreSQL\13\data\pg_wal\0000000100000011000000F4 ... postgres.exe       pid: 34260  type: File           C18: C:\Program Files\PostgreSQL\13\data\pg_wal\0000000100000011000000FC postgres.exe       pid: 34484  type: File           C48: C:\Program Files\PostgreSQL\13\data\pg_wal\0000000100000011000000FC postgres.exe       pid: 38740  type: File           180: C:\Program Files\PostgreSQL\13\data\pg_wal\0000000100000012000000B7 > Attached is the > patch that should be tested, based on the suspected commit. There are > actually two scenarios to worry about: > - Check that the code of 13.2 compiled manually is enough to see the > failure. > - Check that once the patch attached is applied makes the failure go > away. > Intel server has PostgreSQL 13.1, compiled by Visual C++ build 1914, 64-bit and AMD server PostgreSQL 13.2, compiled by Visual C++ build 1914, 64-bit Should I try install Visual C++ , compile and replace postgres.exe file in AMD server. > I am trying on my side to reproduce the problem in a more reliable > way. One thing I saw breaking in my setup is archive_command, where > it was not able to archive a segment with a simple copy, failing with > the same error as yours. wal archiving is not used on those servers. > In one of those servers, do you have in pg_wal/ some files named > xlogtemp.N? N is an integer that would be the PID of the process that > generated it. No. Intel server has 4 files with .deleted extension. AMD server has no .deleted files. It has probably lower traffic. Andrus. --------------B0C1FA4E4D741AFF1296BE3C Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit

Hi!

>Those ten seconds are coming from RemoveXlogFile(), where pgrename()
loops 100 times for 100ms before giving up.  So something holding up
the file's handle prevents the removal to happen.  

I tried sysinternals  

handle pg_wal

It shows that only postgres processes have opened files in pg_wal directory:

postgres.exe       pid: 11800  type: File           CC0: C:\Program Files\PostgreSQL\13\data\pg_wal\0000000100000012000000B7
postgres.exe       pid: 11800  type: File          12B8: C:\Program Files\PostgreSQL\13\data\pg_wal
postgres.exe       pid: 23904  type: File          1134: C:\Program Files\PostgreSQL\13\data\pg_wal\0000000100000012000000B5
postgres.exe       pid: 20908  type: File           17C: C:\Program Files\PostgreSQL\13\data\pg_wal\0000000100000012000000B7
postgres.exe       pid: 29892  type: File           C08: C:\Program Files\PostgreSQL\13\data\pg_wal\0000000100000011000000F4
...
postgres.exe       pid: 34260  type: File           C18: C:\Program Files\PostgreSQL\13\data\pg_wal\0000000100000011000000FC
postgres.exe       pid: 34484  type: File           C48: C:\Program Files\PostgreSQL\13\data\pg_wal\0000000100000011000000FC
postgres.exe       pid: 38740  type: File           180: C:\Program Files\PostgreSQL\13\data\pg_wal\0000000100000012000000B7


Attached is the
patch that should be tested, based on the suspected commit.  There are
actually two scenarios to worry about:
- Check that the code of 13.2 compiled manually is enough to see the
failure.
- Check that once the patch attached is applied makes the failure go
away.

Intel server has

PostgreSQL 13.1, compiled by Visual C++ build 1914, 64-bit

and AMD server

PostgreSQL 13.2, compiled by Visual C++ build 1914, 64-bit

Should I try install Visual C++ , compile and replace postgres.exe file in AMD server.

I am trying on my side to reproduce the problem in a more reliable
way.  One thing I saw breaking in my setup is archive_command, where
it was not able to archive a segment with a simple copy, failing with
the same error as yours.
wal archiving is not used on those servers.
In one of those servers, do you have in pg_wal/ some files named
xlogtemp.N?  N is an integer that would be the PID of the process that
generated it.

No. Intel server has 4 files with .deleted extension. AMD server has no .deleted files. It has probably lower traffic.

Andrus.

--------------B0C1FA4E4D741AFF1296BE3C--