[ZODB-Dev] HOWTO recover from Data.fs.tmp
Tim Peters
tim.peters at gmail.com
Mon Oct 2 16:36:15 EDT 2006
[Juan Pablo Giménez]
> ok... but, if you delete Data.fs zope keep running, writing data into Data.fs.tmp,
> and don't log nothing about it. Sorry, but that's a bug...
Well, if it is, it's an operating system "bug": you normally don't
"delete" files on Unix-like systems, you merely "unlink" them, meaning
that the file (inode) still exists, but you remove the /directory
entry/ pointing to the file. Then there's no longer any wholly
obvious way to access the file, as the file no longer "has a name".
Processes (like ZODB) that have a file descriptor open can still write
to (and read from, etc) the file with no problems at all -- /nothing
has changed/ from their point of view. A process couldn't care less
about the name of a file after they've opened that file.
Windows doesn't make this distinction: it's impossible to delete (or
rename) an open file on Windows; there is no distinct "unlink"
concept. Linux couldn't care less. You might think you'd prefer
Windows file semantics, but, trust me ;-), you wouldn't. It would
prevent the specific problem you're having, but creates other
problems.
BTW, if you unlink Data.fs.tmp on a Unix-like system, same thing:
ZODB will keep using the original file, despite that you can no longer
"see" it with ordinary user-level filesystem tools (ls, etc).
More information about the ZODB-Dev
mailing list