Subject Re: Major Incident where db rolled back to restore point
Author Peter Chaisty
Hi Thanks for that Milan

Its good advice , I can certainly modify my backup restore procedure
to incorporate your suggestions (although I am terrified now of doing
this).

I am also updating the server in a couple of weeks so I may look at
other linux os's eg debian.

The fedora system used EXT3.

I know the backup running locally had finished because I waited for
gbak to complete in a terminal window and there were definitely no
other processes running on the db (we do this as a 2 man job checking
before we press return on any script - lets just say we are paranoid).
The previous windows gbak though, if terminating the gbak operation in
windows did not stop the gbak process then I know it would have still
been running as it takes hrs from the windows network pc.

So can we make a statement here that running gbak remotely starts a
process in the server that is not halted when the remote gbak
application is closed ?

I will definitely use fuser in future as well, that is excellent advice.

I am still looking for a good answer but what I read from this is that
one strong possibility is a an error in my backup / restore
procedure, although again the rollback only occured when I ran gbak
(no file renames or restore).
I welcome other comments / ideas ?

Rgds

Peter





--- In firebird-support@yahoogroups.com, "Milan Babuskov" <milanb@...>
wrote:
>
> --- Peter Chaisty wrote:
> > 1/ logged in on linux (fedora)
>
> I wouldn't recommend anyone to run Fedora on production system, as it
> is a test problems and has some subtle bugs. If you want a RedHat
> system, CentOS is a much better option.
>
> > 2/ Closed down all connections
> > 3/ ran gbak to a backups sub dir (local gbak)
> > 4/ did a restore of the backup to another sub dir
> > 5/ renamed original db
>
> At this point you should always check whether some program holds the
> file descriptor open, as Linux filesystems allow you to move a file
> which is open. Easiest way is with command 'fuser' like this:
>
> fuser /path/to/db/file.fdb
>
> If it doesn't print anything, than it's ok.
>
> BTW, which filesystem do you use?
>
> > 24 hrs later, june 5th
> >
> > 8/ closed down connections
> > 9/ started a backup on remote windows pc using gbak / closed it
> > because it was taking too long
>
> When you 'close' the backup continues - file remains open and firebird
> process keeps writing to it. You have to manually kill that process!
>
> > Really I am just trying to work out what I did wrong so that this
> > will
>
> Two things to remember (although I haven't seen them anywhere in the
> docs) if you are a Linux user:
>
> 1. files can get deleted or moved while in use - process using it
> knows nothing about it and can keep reading and writing into the void.
>
> Use 'fuser' command to make sure the file is really moved or deleted.
>
> 2. When you cancel backup in your application or admin. tool it keeps
> running on the server - you have to kill it manually.
>
>
> --
> Milan Babuskov
> http://www.flamerobin.org
>