pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Andres Freund <andres@anarazel.de>
Cc: pdrolet@infodata.ca
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13143: Cannot stop and restart a streaming server with a replication slot
Date: Mon, 27 Apr 2015 11:44:47 -0300
Message-ID: <20150427144447.GT4369@alvh.no-ip.org> (raw)
In-Reply-To: <20150425123357.GC12723@awork2.anarazel.de>
References: <20150424101006.2556.60897@wrigleys.postgresql.org>
	<20150425123357.GC12723@awork2.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Andres Freund wrote:

> On 2015-04-24 10:10:06 +0000, pdrolet@infodata.ca wrote:

> > 2015-04-24 04:47:12 EDT LOG:  le système de bases de données a été arrêté à
> > 2015-04-24 04:44:37 EDT
> > 2015-04-24 04:47:12 EDT PANIC:  n'a pas pu synchroniser sur disque (fsync)
> > le fichier « pg_replslot/node_win2012sec/state » : Bad file descriptor
> > 2015-04-24 04:47:12 EDT LOG:  processus de lancement (PID 23180) quitte avec
> > le code de sortie 3
> > 2015-04-24 04:47:12 EDT LOG:  annulation du démarrage à cause d'un échec
> > dans le processus de lancement
> > 
> > To restart the server, I have to manually delete the folder in pg_replslot.
> > But then I need to re build the slave. Not very practical for a multi
> > gigabyte database. 
> 
> Obviously that's not how it supposed to be. I don't have access to a
> windows systems, much less a french one unfortunately.

I think this is failing in the fsync_fname() call in slot.c line 1045
(REL9_4_STABLE).  Notice it's in a critical section (hence PANIC) and
isdir=false.  This happens just after the rename() from tmppath to path;
maybe the file is "busy" and could not be renamed?  Anyway the rename
itself didn't fail, and the file (under the new name) could be opened by
fd.c, otherwise the error would say "could not open" instead of "could
not fsync".

There are many other callers of rename() and none of them seem to have
special cases for WIN32 specifically; they all assume it works.  (Some
of them are in turn special cases related to link/unlink).

The vast majority of callers of fsync_fname() are related to logical
decoding, so it seems fair game to assume that that code is missing a
trick or two.

> 2) Check that it's unrelated to any anti-virus software running?

It seems likely that something like this is related.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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



view thread (10+ messages)  latest in thread

Message-ID: <20150427144447.GT4369@alvh.no-ip.org>
Permalink:  ../20150427144447.GT4369@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20150427144447.GT4369@alvh.no-ip.org

 · 

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-bugs@postgresql.org
  Cc: alvherre@2ndquadrant.com, andres@anarazel.de, pdrolet@infodata.ca
  Subject: Re: BUG #13143: Cannot stop and restart a streaming server with a replication slot
  In-Reply-To: <20150427144447.GT4369@alvh.no-ip.org>
  References: <20150424101006.2556.60897@wrigleys.postgresql.org> <20150425123357.GC12723@awork2.anarazel.de> <20150427144447.GT4369@alvh.no-ip.org>

* 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