Reviewed: https://review.opendev.org/614190 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=1b597f759f9133964fd580d9e0eefd4cd6eb819f Submitter: Zuul Branch: master
commit 1b597f759f9133964fd580d9e0eefd4cd6eb819f Author: Gorka Eguileor <[email protected]> Date: Tue Oct 30 11:51:03 2018 +0100 Use os-brick locking for volume attach and detach Cinder introduced "shared_targets" and "service_uuid" fields in volumes to allow volume consumers to protect themselves from unintended leftover devices when handling iSCSI connections with shared targets. Nova avoids races caused by automatic rescans on iSCSI volumes when detaching a volume while Cinder is mapping another volume to the same host by locking and only allowing one attach or one detach operation for each server to happen at a given time if "shared_targets" is set to True. When using an up to date Open iSCSI initiator we don't need to use locks, as it is possible to disable automatic LUN scans (which are the real cause of the leftover devices), and OS-Brick already supports this feature. Currently Nova is blindly locking whenever "shared_targets" is set to True, even when the iSCSI initiator and OS-Brick are already presenting such races, which introduces unnecessary locking and serialization on the connection of volumes. This patch uses the new context manager introduced in OS-Brick to allow Nova to abstract its code from all this storage internal details and to only lock when it's really necessary. Depends-On: I4970363301d5d1f4e7d0f07e09b34d15ee6884c3 Closes-Bug: #1800515 Change-Id: Ie9106d5832d6a728ea97a8dbb5ddb5dcc17a2ec4 ** Changed in: nova Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1800515 Title: Unnecessary locking when connecting volumes Status in OpenStack Compute (nova): Fix Released Bug description: Cinder introduced "shared_targets" and "service_uuid" fields in volumes to allow volume consumers to protect themselves from unintended leftover devices when handling iSCSI connections with shared targets. The way to protect from the automatic scans that happen on detach/map race conditions is by locking and only allowing one attach or one detach operation for each server to happen at a given time. When using an up to date Open iSCSI initiator we don't need to use locks, as it has the possibility to disable automatic LUN scans (which are the real cause of the leftover devices), and OS-Brick already supports this feature. Currently Nova is blindly locking whenever "shared_targets" is set to True, even when the iSCSI initiator and OS-Brick are already presenting such races, which introduces unnecessary serialization on the connection of volumes. To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1800515/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

