Re: SV: Log files polluted with permission denied error messages after every 10 seconds

Andrus <kobruleht2@hot.ee>

From: Andrus <kobruleht2@hot.ee>
To: Michael Paquier <michael@paquier.xyz>
Cc: Thomas Munro <thomas.munro@gmail.com>, Niels Jespersen <NJN@dst.dk>, Tom Lane <tgl@sss.pgh.pa.us>, Laurenz Albe <laurenz.albe@cybertec.at>, pgsql-general <pgsql-general@postgresql.org>
Date: 2021-03-16T23:09:24Z
Lists: pgsql-general
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.

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix concurrency issues with WAL segment recycling on Windows