Re: BUG #4162: Hotbackup recovery doesn't work in windows - Mailing list pgsql-bugs

From Javier Pimás
Subject Re: BUG #4162: Hotbackup recovery doesn't work in windows
Date
Msg-id 966571780805131320xb21303dq7fd6fec44904566e@mail.gmail.com
Whole thread Raw
In response to Re: BUG #4162: Hotbackup recovery doesn't work in windows  (Magnus Hagander <magnus@hagander.net>)
Responses Re: BUG #4162: Hotbackup recovery doesn't work in windows
Re: BUG #4162: Hotbackup recovery doesn't work in windows
List pgsql-bugs
Hi, I'm making a base backup, and then I try to recover from it. I install postgres from msi installer, add some tables and data and then follow the steps in "24.3.2. Making a Base Backup". I don't keep archiving files forever but archive just the indispensable (basicaly the same than pg_hotbackup project but in windows).
After that I tryied to test the backup by reinstalling postgres and  following the steps in  "24.3.3. Recovering using a Continuous Archive Backup" . It fails in step 8, throwing an error message box. After a while I downloaded postgres source files and debug symbols and attached visual studio to postgres.exe and debugged it. It always failed in the line I told before. It may be possible that any kind of recovery be failing, I didn't test.

I'm not compiling anything, but made a binary patch to the exe (I was in a hurry!) that avoids calling close with -1 and recovery process started working.

On Tue, May 13, 2008 at 5:14 PM, Magnus Hagander <magnus@hagander.net> wrote:
Simon Riggs wrote:
> On Tue, 2008-05-13 at 00:45 +0000, Javier wrote:
> > The following bug has been logged online:
> >
> > Bug reference:      4162
> > Logged by:          Javier
> > Email address:      elpochodelagente@gmail.com
> > PostgreSQL version: 8.3.1
> > Operating system:   Windows XP SP2
> > Description:        Hotbackup recovery doesn't work in windows
> > Details:
> >
> > I've found that the hotbackup recovery process as described in
> > http://www.postgresql.org/docs/8.3/interactive/continuous-archiving.html
> > fails in windows.
>
> What are you running and how are you running this exactly?
>
> Please can you provide more details rather than your thoughts on
> > The cause...
>
> If what you say is correct then it is crash recovery that is failing.

I think the analysis of the cause itself is correct - we can end up
calling close(-1), and that will fail *on some versions of the
runtime*. It doesn't crash on all. There may also be something else
that's broken that's causing it to happen in this case, but that code
certainly looks dangerous to me. I'd be inclined to fix it along the
way he suggests, even if it's not the root cause of this  issue. Any
objection to that?

Javier - is this happening with the binary win32 build, or do you have
your own build? If you have your own, what compiler and runtime are you
using?

//Magnus



--
Javier Pimás
Ciudad de Buenos Aires

pgsql-bugs by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: BUG #4162: Hotbackup recovery doesn't work in windows
Next
From: Magnus Hagander
Date:
Subject: Re: BUG #4162: Hotbackup recovery doesn't work in windows