couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juhani Ränkimies <juh...@juranki.com>
Subject Windows file handling problems (was: Windows 0.11 snapshot)
Date Sun, 14 Mar 2010 13:43:54 GMT
On Sat, Feb 27, 2010 at 1:00 AM, Mark Hammond <skippy.hammond@gmail.com> wrote:
>
> The root of this strategy comes from a realization that if a file is opened
> on windows with FILE_SHARE_DELETE, the file can be deleted *or renamed*
> while it is open.  One limitation is that a file of the same name can not be
> re-created while the old one still has handles open (the 'deleted but still
> open' file still appears in directory listings until the handle is closed,
> for example)
>
> Given this, what we can do is something like:
>
> * Arrange for erlang to be able to open the DB and view files with this
> flag.
> * Instead of deleting a file before replacing it, we first rename the file
> to a unique name (ie, based on a UUID) in a special directory.
> * As couch starts up, attempt to delete any old files in this special
> directory.  In theory, no such files should exist - the OS should take care
> of actually removing any such files even if erlang crashes.
>
> The end result of this is that things can be made to work with a lot less
> friction than the 'file versioning' scheme.  I've a patch to couchdb that
> works when used with a patch to erlang to open *all* files with that flag.

Is the couchdb patch available somewhere?

cheers,
-juhani

Mime
View raw message