pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Andreas Kretschmer <andreas@a-kretschmer.de>
Cc: Shani Israeli <sisraeli@illusivenetworks.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: PANIC: could not write to log file {} at offset {}, length {}: Invalid argument
Date: Wed, 04 Nov 2020 22:23:04 -0500
Message-ID: <1408355.1604546584@sss.pgh.pa.us> (raw)
In-Reply-To: <20201105021012.GD1632@paquier.xyz>
References: <CAHwa7Ea1R7kYuyEOKU6LW-tYMXJAM30zy9K+4iYW5TykAgKDgQ@mail.gmail.com>
	<58D3BF80-A360-4E40-883A-B3DE64DE1189@a-kretschmer.de>
	<20201105021012.GD1632@paquier.xyz>

Michael Paquier <michael@paquier.xyz> writes:
> On Wed, Nov 04, 2020 at 01:24:46PM +0100, Andreas Kretschmer wrote:
>> wild guess: Antivirus Software?

> Perhaps not.  To bring more context in here, PostgreSQL opens any
> files on WIN32 with shared writes and reads allowed to have an
> equivalent of what we do on all *nix platforms.  Note here that the
> problem comes from a WAL segment write, which is done after the file
> handle is opened in shared mode.  As long as the fd is correctly
> opened, any attempt for an antivirus software to open a file with an 
> exclusive write would be blocked, no?

The only hard data point we've got here is the "Invalid argument"
string, which should mean EINVAL, although I'm not entirely sure
where that string is determined in a Windows build.  So it seems
like there are two possibilities:

* The actual underlying Windows error code is one of the ones
that win32error.c maps to EINVAL:

                ERROR_INVALID_FUNCTION, EINVAL
                ERROR_INVALID_ACCESS, EINVAL
                ERROR_INVALID_DATA, EINVAL
                ERROR_INVALID_PARAMETER, EINVAL
                ERROR_INVALID_HANDLE, EINVAL
                ERROR_NEGATIVE_SEEK, EINVAL

* The actual underlying Windows error code is something that
win32error.c doesn't know, which would cause _dosmaperr() to
return EINVAL.

The latter case would result in a LOG message "unrecognized win32 error
code", so it would be good to know if any of those are showing up in
the postmaster log.

Seems like maybe it wasn't a great idea for _dosmaperr's fallback
errno to be something that is also a real error code.

			regards, tom lane





view thread (10+ messages)  latest in thread

Message-ID: <1408355.1604546584@sss.pgh.pa.us>
Permalink:  ../1408355.1604546584@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1408355.1604546584@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michael@paquier.xyz, andreas@a-kretschmer.de, sisraeli@illusivenetworks.com
  Subject: Re: PANIC: could not write to log file {} at offset {}, length {}: Invalid argument
  In-Reply-To: <1408355.1604546584@sss.pgh.pa.us>
  References: <CAHwa7Ea1R7kYuyEOKU6LW-tYMXJAM30zy9K+4iYW5TykAgKDgQ@mail.gmail.com> <58D3BF80-A360-4E40-883A-B3DE64DE1189@a-kretschmer.de> <20201105021012.GD1632@paquier.xyz> <1408355.1604546584@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox