Unnecessary locking when connecting volumes

Bug #1800515 reported by Gorka Eguileor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Lee Yarwood

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.

Gorka Eguileor (gorka)
Changed in nova:
assignee: nobody → Gorka Eguileor (gorka)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/614190

Changed in nova:
status: New → In Progress
Changed in nova:
assignee: Gorka Eguileor (gorka) → Lee Yarwood (lyarwood)
Changed in nova:
assignee: Lee Yarwood (lyarwood) → Gorka Eguileor (gorka)
Changed in nova:
assignee: Gorka Eguileor (gorka) → Lee Yarwood (lyarwood)
Changed in nova:
assignee: Lee Yarwood (lyarwood) → Gorka Eguileor (gorka)
Changed in nova:
assignee: Gorka Eguileor (gorka) → Lee Yarwood (lyarwood)
Matt Riedemann (mriedem)
tags: added: libvirt volumes
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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 address hidden>
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
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.