Skip site navigation (1) Skip section navigation (2)

Re: [Win32] Problem with rename()

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Brant <Peter(dot)Brant(at)wicourts(dot)gov>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: [Win32] Problem with rename()
Date: 2006-04-18 00:58:36
Message-ID: 200604180058.k3I0was02090@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-patches
Peter Brant wrote:
> Hi all,
> 
> In the last couple of days, we've been bitten (a couple of times, on
> different servers) by an apparent glitch or bad interaction in the
> Windows implementation of rename().
> 
> The relevant log message is:
> 
> [2006-04-17 16:49:22.583 ] 2252 LOG:  could not rename file
> "pg_xlog/000000010000010A000000BD" to
> "pg_xlog/000000010000010A000000D7", continuing to try
> 
> It apparently just keeps on looping indefinitely.  The "completed
> rename" message from port/dirmod.c never shows up.
> 
> Shortly thereafter, Postgres becomes unresponsive.  Attempts to make a
> new connection just block.  Autovacuums block.  A "pg_ctl ... stop -m
> fast" doesn't work.  Only "pg_ctl ... stop -m immediate" does.
> 
> With the last occurrence, I saved off the output of "handle -a" and
> "pslist -x" in case that's helpful.  
> 
> Any thoughts on what might be going wrong?  If it happens again, what
> other clues should I be looking for?

Yes, comment I added to dirmod.c give a hint:

    /*
     * We need these loops because even though PostgreSQL uses flags that
     * allow rename while the file is open, other applications might have
     * these files open without those flags.
     */

so someone else has the file opened, but didn't use the required flags. 
As to what could have it open, I don't know.

-- 
  Bruce Momjian   http://candle.pha.pa.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

Responses

pgsql-bugs by date

Next:From: Qingqing ZhouDate: 2006-04-18 01:54:08
Subject: Re: [Win32] Problem with rename()
Previous:From: Bruce MomjianDate: 2006-04-18 00:52:30
Subject: Re: [martin@bugs.unl.edu.ar: BUG in logs]

pgsql-patches by date

Next:From: Qingqing ZhouDate: 2006-04-18 01:54:08
Subject: Re: [Win32] Problem with rename()
Previous:From: Peter EisentrautDate: 2006-04-18 00:12:00
Subject: Re: pg_ctl options checking

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group