[openstack-dev] [cinder][oslo] Locks for create from volume/snapshot

Joshua Harlow harlowja at outlook.com
Sat Jun 27 16:42:16 UTC 2015


Something that I would prefer is to get the following merged:

https://github.com/python-zk/kazoo/pull/306

Then we can have tooz (http://docs.openstack.org/developer/tooz/) have a 
implementation of that (using the above PR #306 for the kazoo/zookeeper 
impl) and providing impls of it for the various drivers listed there 
(where possible).

That way such a shared lock concept is applicable for others outside of 
openstack (as tooz is made for a wider audience) and also for those 
inside of openstack.

I do have https://fasteners.readthedocs.org (which is what 
oslo.concurrency is now using) which does have a shared lock (but its 
only useful in a single process, as its a shared lock among threads...) 
@ 
https://fasteners.readthedocs.org/en/latest/api/lock.html#fasteners.lock.ReaderWriterLock

If you want, feel free to look over PR #306 above, and maybe we can 
figure out how this can be integrated into tooz (and then exposed to 
cinder, if the cinder folks desire it there).

-Josh

niuzhenguo wrote:
> Hi folks,
>
> Currently we use a lockfile to protect the create operations from
> concurrent delete the source volume/snapshot, we use exclusive
>
> locks on both delete and create sides which will ensure that:
>
> 1.If a create of VolA from snap/VolB is in progress, any delete requests
> for snap/VolB will wait until the create is complete.
>
> 2.If a delete of snap/VolA is in progress, any create from snap/VolA
> will wait until snap/VolA delete is complte.
>
> but, the exclusive locks will also result in:
>
> 3.If a create of VolA from snap/VolB is inprogress, any other create
> requests from snap/VolB will wait until the create is complete.
>
> So the create operations from same volume/snapshot can not process on
> parallel, please reference bp [1].
>
> I’d like to change the current filelock or introduce a new lock to
> oslo.concurrency.
>
> Proposed change:
>
> Add exclusive(write) locks for delete operations and shared(read) locks
> for create operations, to ensure that create from volume/snapshot
>
> can work on parallel and protect create operations from concurrent
> delete the source volume/snapshot.
>
> I’d like to get what’s your suggestions, thanks in advance.
>
> [1] https://blueprints.launchpad.net/cinder/+spec/enhance-locks
> <https://blueprints.launchpad.net/cinder/+spec/enhance-locks>
>
> -zhenguo
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



More information about the OpenStack-dev mailing list