On Wed, 2021-03-17 at 01:09 +0200, Andrus wrote: > > 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 I think what it would be most helpful to run "process monitor", so that you get a log of the system calls and errors; perhaps that shows some details that we cannot get from the error message. Yours, Laurenz Albe