add API to atomically set a child URI and return both the new child and its metadata #1035

Open
opened 2010-05-11 01:26:08 +00:00 by davidsarah · 0 comments
davidsarah commented 2010-05-11 01:26:08 +00:00
Owner

The set_uri and set_node operations of a DirectoryNode set a child directory entry to a new URI or node object respectively. They return a Deferred for the new child.

It would be useful to be able to return a (child, metadata) pair instead, i.e. to include the metadata that was actually used (including times that are set automatically). This avoids a race condition where the child may be deleted or its metadata changed between set_uri/set_node and a call to get_metadata_for. For example the new SFTP implementation would like to use this operation in its code for supporting the EXCL flag (atomic file creation).

I suggest a return_child_and_metadata option argument defaulting to False, rather than new methods.

The `set_uri` and `set_node` operations of a `DirectoryNode` set a child directory entry to a new URI or node object respectively. They return a Deferred for the new child. It would be useful to be able to return a (child, metadata) pair instead, i.e. to include the metadata that was actually used (including times that are set automatically). This avoids a race condition where the child may be deleted or its metadata changed between `set_uri`/`set_node` and a call to `get_metadata_for`. For example the new SFTP implementation would like to use this operation in its code for supporting the `EXCL` flag (atomic file creation). I suggest a `return_child_and_metadata` option argument defaulting to `False`, rather than new methods.
tahoe-lafs added the
code-dirnodes
major
enhancement
1.6.1
labels 2010-05-11 01:26:08 +00:00
tahoe-lafs added this to the 1.8.0 milestone 2010-05-11 01:26:08 +00:00
tahoe-lafs modified the milestone from 1.8.0 to soon 2010-08-09 22:19:33 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/trac-2024-07-25#1035
No description provided.