pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christian Ullrich <chris@chrullrich.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: Why does the WAL writer sit on completed segments (on Windows)?
Date: Mon, 17 Apr 2017 11:28:31 -0400
Message-ID: <17213.1492442911@sss.pgh.pa.us> (raw)
In-Reply-To: <od2lad$df0$1@blaine.gmane.org>
References: <od2lad$df0$1@blaine.gmane.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

Christian Ullrich <chris@chrullrich.net> writes:
> The reason, as Process Monitor shows, is that the WAL writer process 
> keeps the file open for about one second after the 
> archive_status\*.ready file has been created. The archiver runs the 
> archive_command "too early", resulting in the sharing [1] violation seen 
> above.

I'm not sure why that happens, but even if we changed the logic inside
walwriter to avoid it, you'd still need to adapt your archiving script
to deal with the case.  The reason is that the walwriter isn't necessarily
the only process writing WAL --- regular backends do it too, depending on
timing.  In such a case a backend would be holding an open-file reference
until the next time it tries to write WAL, which might be awhile.  It's
not really practical to change that behavior; we certainly wouldn't want
to open and close WAL files for every write.

			regards, tom lane


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (8+ messages)  latest in thread

Message-ID: <17213.1492442911@sss.pgh.pa.us>
Permalink:  ../17213.1492442911@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17213.1492442911@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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, chris@chrullrich.net
  Subject: Re: Why does the WAL writer sit on completed segments (on Windows)?
  In-Reply-To: <17213.1492442911@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