[sheepdog] [RFC] create onode before uploading object completed

Robin Dong robin.k.dong at gmail.com
Mon Jan 6 10:16:22 CET 2014


Hi All,

At present, the implemention of swift interface for creating object in
sheepdog is:

1. lock container
2. check whether the onode with same object name is exists.
3. unlock container
4. upload object
5. create onode

this sequence have a problem: if two clients uploading same objects
concurrently, it will create two
objects with same names in container.To avoid duplicated names, we must put
"create onode"
operation in container lock regions.

Therefore we need to change the processes of creating object to:

1. lock container
2. check whether the onode is exists.
3. allocate data space for object, and create onode, then write it done
4. unlock container
5. upload object

this routine will avoid uploading duplicated objects.

There is an exception on the new routine: if the client halt the uploading
progress, we will have a
"uploading uncompleted" onode.
I think this problem is easy to solve: we can add code for onode to
identify its status.
A new onode will be set to "INIT", and after uploading completed, the onode
will be set to  "COMPLETED".
So, when users try to use swift interface to GET a "uncompleted" object,
sheep will find out the onode is
"INIT" which means "not completed", so sheep will return "partial
content"for http request, and user could
DELETE the object and upload it again.


Is there any suggestion for this new design ?

-- 
--
Best Regard
Robin Dong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20140106/1a0b5db8/attachment-0003.html>


More information about the sheepdog mailing list