Opened at 2008-04-23T18:49:37Z
Closed at 2008-05-09T01:18:41Z
#391 closed enhancement (fixed)
avoid auto-collision on mutable files
Reported by: | warner | Owned by: | warner |
---|---|---|---|
Priority: | major | Milestone: | 1.1.0 |
Component: | code-mutable | Version: | 1.0.0 |
Keywords: | dirnode mutable | Cc: | |
Launchpad Bug: |
Description
It would be convenient if there were no way to make a single Tahoe node perform a colliding write with itself. What that means is that two dirnode-mutate operations on the same directory, given to a single tahoe node at about the same time, should result in two successes, rather than at least one uncoordinated write error.
To accomplish this, we need:
- a weakref table (in the client) that maps URI to DirectoryNode or MutableFileNode instance, so that two operations on the same node will use the same instance.
- some locking/queueing/sequencing code in the DirectoryNode to cause the second operation to wait until the first has finished. There is already code for this purpose in MutableFileNode.
The fact that MutableFileNode.modify is covered by the MFN lock may mean that we don't actually need any additional locking code in DirectoryNode. But we still need the singleton table.
Change History (4)
comment:1 Changed at 2008-04-24T23:46:21Z by warner
- Component changed from code-encoding to code-mutable
comment:2 Changed at 2008-05-05T22:55:21Z by zooko
- Milestone changed from undecided to 1.1.0
comment:3 Changed at 2008-05-09T00:51:53Z by warner
- Owner set to warner
- Status changed from new to assigned
comment:4 Changed at 2008-05-09T01:18:41Z by warner
- Resolution set to fixed
- Status changed from assigned to closed
I just implemented this, in 26187bfc8166a868. It was pretty easy, actually.
see also #265