[ZODB-Dev] Re: HOWTO recover from Data.fs.tmp

Tres Seaver tseaver at palladion.com
Mon Oct 2 15:54:09 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Benji York wrote:
> Russ Ferriday wrote:
>> But for an app to be writing into thin air without complaining - 
>> THAT's a bug!
>> Even having a backup of the Data.fs would not help!
>> Not picking on zope, but if that's what's happening it has to be 
>> called a bug.
> 
> True.  It is much more likely that the Data.fs was replaced about a week
> ago (say an attempted backup restore) and the Zope process wasn't
> restarted.  That is one way to evoke the observed behavior.
> 
> Since this is apparently a flavor of Unix, the output of "lsof" might be
> helpful.  It should show you if you have a Zope process that is holding
> onto a deleted file.
> 
> If this is the case you'll have to get imaginative to recover the file.
>  Killing the process and immediately attempting to "undelete" it might
> work (for some file systems, apparently not ext3).

I wouldn't suggest killing the process except as a complete last resort.
 Rather, I would verify ths by looking at /proc/<PID_OF_ZOPE>/fd.  If it
looks like the following:

$ ls /proc/2222/fd
lr-x------ 1 tseaver tseaver 64 2006-10-02 15:49 0 -> pipe:[212984]
l-wx------ 1 tseaver tseaver 64 2006-10-02 15:49 1 -> pipe:[212985]
l-wx------ 1 tseaver tseaver 64 2006-10-02 15:49 2 -> pipe:[212986]
l-wx------ 1 tseaver tseaver 64 2006-10-02 15:49 3 ->
/home/tseaver/projects/sandbox/logs/zeo-zeo.log
lrwx------ 1 tseaver tseaver 64 2006-10-02 15:49 4 ->
/home/tseaver/projects/sandbox/instances/zeo/var/Data.fs.lock
lrwx------ 1 tseaver tseaver 64 2006-10-02 15:49 5 ->
/home/tseaver/projects/sandbox/instances/zeo/var/Data.fs.tmp
lrwx------ 1 tseaver tseaver 64 2006-10-02 15:49 6 ->
/home/tseaver/projects/sandbox/instances/zeo/var/Data.fs (deleted)
lrwx------ 1 tseaver tseaver 64 2006-10-02 15:49 7 -> socket:[212991]

(note the '(deleted)' on the end), then you have this problem

In that case, I think I would be tempted to attach to Zope with 'gdb',
and try to get the the instance of the FileStorage which is holding open
the file.  From there, you should be able to create another storage,
using a temporary filenaame, and then call its 'copyTransactionsFrom'
(sp?) method, passing the original storage.


Tres.
- --
===================================================================
Tres Seaver          +1 202-558-7113          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFIW5g+gerLs4ltQ4RAjtNAKCfcAEb+OPIs4qE/eBg1Bd08ZnbcgCgxnFG
lREjSifP1SSwkDr5jDnS5b8=
=cGFt
-----END PGP SIGNATURE-----



More information about the ZODB-Dev mailing list