RE: PostgreSQL 10.20 crashes / Antivirus

From: "Thomas, Richard" <Richard(dot)Thomas(at)atkinsglobal(dot)com>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>, "adrian(dot)klaver(at)aklaver(dot)com" <adrian(dot)klaver(at)aklaver(dot)com>
Subject: RE: PostgreSQL 10.20 crashes / Antivirus
Date: 2022-04-19 11:59:41
Message-ID: LO2P123MB5094561359D24D8273F8CFDEF1F29@LO2P123MB5094.GBRP123.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

A request for further suggestions for how to fix/diagnose this PG crash (having just got back from holiday I discover that PG is still crashing even though I have changed the pgdump target output location to a folder excluded from the McAfee Antivirus scanning - but thanks for the suggestion Adrian). The last few crashes have occurred only during the backup process, when database pg_dump completes (successfully - including the disconnection message in the log) but before the next database pgdump can begin (that pg_dump command gets the error that it cannot connect to the database as the server is no longer responding). This will happen after dumping several databases - sometimes it manages the complete multiple database dump fine. One new thing I've noticed is that when it fails the file access 0xC0000022 error occurs a second time when PG is trying to restart itself after shutting down all the other processes, suggesting whatever caused the crash is still around (a later manual restart works fine):

2022-04-15 03:54:06 BST: [3720] WARNING: 57P02: terminating connection because of crash of another server process
2022-04-15 03:54:06 BST: [3720] DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2022-04-15 03:54:06 BST: [3720] HINT: In a moment you should be able to reconnect to the database and repeat your command.
2022-04-15 03:54:06 BST: [3720] LOCATION: quickdie, postgres.c:2622
2022-04-15 03:54:06 BST: [7900] LOG: 00000: all server processes terminated; reinitializing
2022-04-15 03:54:06 BST: [7900] LOCATION: PostmasterStateMachine, postmaster.c:3924
2022-04-15 03:54:08 BST: [7900] LOG: 00000: startup process (PID 3652) was terminated by exception 0xC0000022
2022-04-15 03:54:08 BST: [7900] HINT: See C include file "ntstatus.h" for a description of the hexadecimal value.
2022-04-15 03:54:08 BST: [7900] LOCATION: LogChildExit, postmaster.c:3650
2022-04-15 03:54:08 BST: [7900] LOG: 00000: aborting startup due to startup process failure
2022-04-15 03:54:08 BST: [7900] LOCATION: reaper, postmaster.c:2907
2022-04-15 03:54:09 BST: [7900] LOG: 00000: database system is shut down
2022-04-15 03:54:09 BST: [7900] LOCATION: UnlinkLockFiles, miscinit.c:765

Some details from my original email (as it was 2 weeks ago):

I’ve been having problems with several PostgreSQL crashes over the last month (originally with 10.16, then more recently with 10.20, all on a Windows Server 2012R2 platform), always with a low level permissions error:
"server process (PID 5664) was terminated by exception 0xC0000022"
(This NT error translates as "Access Denied: A process has requested access to an object but has not been granted those access rights").

I was certainly having issues earlier with McAfee Antivirus causing some of these problems but this has been reduced after following the advice here to prevent scanning of PGDATA folders and postgres.exe (if someone can confirm that reference to “postgresql.exe” is a typo on that page I will correct it, but don’t want to in case it refers to a different version of PostgreSQL):
https://wiki.postgresql.org/wiki/Running_%26_Installing_PostgreSQL_On_Native_Windows#Antivirus_software
I have also got our IT to disable antivirus on our tablespace folder and on the folder running our backup PowerShell script (which calls pg_dump).

Any suggestions for how to fix/diagnose? Some things I have tried already:
- Ran “sfc” (System File Checker) to check for/fix any Windows OS corruptions (none found that were relevant)
- Ran “amcheck” on several of the databases
- Unfortunately checksums are not turned on with the database (not an option with the EDB PostgreSQL Windows Installer) and can’t be turned on after initdb on version 10
- I hoped to run pg_catcheck but cannot find a binary version of this online and I think it would take me quite a lot of work to build it myself (I don’t have Visual Studio, only VSC).

Richard

2022-04-02 02:14:53 BST: [7480] user=scde_suad,db=a9sde,app=pg_dump,host=a9dualling.atkinsgeospatial.com LOG: 00000: duration: 0.816 ms statement: COPY sde.sde_xml_indexes (index_id, index_name, owner, index_type, description) TO stdout;
2022-04-02 02:14:53 BST: [7480] user=scde_suad,db=a9sde,app=pg_dump,host=a9dualling.atkinsgeospatial.com LOCATION: exec_simple_query, postgres.c:1200
2022-04-02 02:14:54 BST: [7480] user=scde_suad,db=a9sde,app=pg_dump,host=a9dualling.atkinsgeospatial.com LOG: 00000: disconnection: session time: 0:36:52.430 user=scde_suad database=a9sde host=a9dualling.atkinsgeospatial.com port=59467
2022-04-02 02:14:54 BST: [7480] user=scde_suad,db=a9sde,app=pg_dump,host=a9dualling.atkinsgeospatial.com LOCATION: log_disconnections, postgres.c:4577
2022-04-02 02:14:55 BST: [5016] LOG: 00000: server process (PID 100) was terminated by exception 0xC0000022

At Atkins - member of the SNC-Lavalin Group, we work flexible hours around the world. Although I have sent this email at a time convenient for me, I don't expect you to respond until it works for you.
NOTICE – This email message and any attachments may contain information or material that is confidential, privileged, and/or subject to copyright or other rights. Any unauthorized viewing, disclosure, retransmission, dissemination, or other use of or reliance on this message or anything contained therein is strictly prohibited and may be unlawful. If you believe you may have received this message in error, kindly inform the sender by return email and delete this message from your system. Thank you.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mats Taraldsvik 2022-04-19 12:39:12 Fwd: Declarative partitioning and partition pruning/check
Previous Message Pól Ua L. 2022-04-19 07:34:33 Joining with calendar table