os-brick/releasenotes/notes
Gorka Eguileor 9090cb79ef Use file locks in connectors
Currently os-brick is using in-process locks that will only prevent concurrent
access to critical sections to threads within a single process.

But based on the comment from iSCSI it seems like the code assumed that
these were file based locks that prevented concurrent access from
multiple processes.

Mentioned iSCSI comment is being removed because it's not correct that
our current retry mechanism will work with connect and disconnect
concurrency issues.

The reason why we haven't seen errors in Nova is because it runs a
single process and locks will be effective.

This is probably also not an issue in some transport protocols, such as
FC and RBD, and it wouldn't be an issue in iSCSI connections that don't
share targets.

But for others, such as  iSCSI with shared targets and NVMe-OF, not
using file locks will create race conditions in the following cases:

- More than 1 cinder backend: Because we can have one backend doing a
  detach in a create volume from image and the other an attach for an
  offline migration.

- Backup/Restore if backup and volume services are running on the same
  host.

- HCI scenarios where cinder volume and nova compute are running on the
  same host, even if the same lock path if configured.

- Glance using Cinder as backend and is running on the same node as
  cinder-volume or cinder-backup.

The problematic race conditions happen because the disconnect will do a
logout of the iSCSI target once the connect call has already confirmed
that the session to the target exists.

We could just add the file locks to iSCSI and NVMe, but I think it's
safer to add it to all the connectors and then, after proper testing, we
can can change back the locks that can be changed, and remove or reduce
the critical section in others.

Closes-Bug: #1947370
Change-Id: I6f7f7d19540361204d4ae3ead2bd6dcddb8fcd68
(cherry picked from commit 6a43669edc)
(cherry picked from commit 19a4820f5c)
Conflicts: os_brick/initiator/connectors/iscsi.py
(cherry picked from commit 08ddf69d64)
Conflicts: os_brick/initiator/connectors/nvmeof.py
(cherry picked from commit b03eca8353)
Conflicts: os_brick/tests/base.py
Conflicts: os_brick/initiator/connectors/iscsi.py
2022-06-21 16:29:25 +09:00
..
add-luks2-support-13563cfe83aba69c.yaml encryptors: Introduce support for LUKS2 2019-09-03 18:44:41 +00:00
add-vstorage-protocol-b536f4e21d764801.yaml Add missing release notes 2016-02-14 10:32:06 -06:00
add-windows-fibre-channel-030c095c149da321.yaml Add Windows Fibre Channel connector 2016-08-04 23:12:09 +03:00
add-windows-iscsi-15d6b1392695f978.yaml release note for windows iSCSI 2016-07-05 15:23:05 -07:00
add-windows-smbfs-d86edaa003130a31.yaml Add Windows SMBFS connector 2016-08-04 23:07:01 +03:00
add_custom_keyring_for_rbd_connection-eccbaae9ee5f3491.yaml RBD: consider a custom keyring in connection info 2017-03-28 15:51:44 +00:00
bug-1722432-2408dab55c903c5b.yaml Update supported transports for iscsi connector 2018-01-16 15:01:53 +08:00
bug-1823200-scaleio-upgrade-3e83b5c9dd148714.yaml Add release note for scaleio connector upgrade 2020-08-17 20:34:52 -07:00
bug-1823200-train-10d7cec0746705df.yaml Remove VxFlex OS credentials from connection_properties 2020-06-03 10:31:43 +03:00
bug-1862443-e87ef38b60f9b979.yaml prepend platform info to by-path string 2021-01-05 00:13:26 +00:00
bug-1865754-ceph-octopus-compatibility-0aa9b8bc1b028301.yaml New fix for rbd connector to work with ceph octopus 2021-06-02 12:13:27 +02:00
bug-1883654-cc069892496bd4a8.yaml Fix "Remove VxFlex OS credentials" regression 2020-06-17 12:00:19 -04:00
bug-1884052-798094496dccf23c.yaml rbd: Support 'rbd showmapped' output from ceph 13.2.0+ 2020-08-28 10:02:15 +01:00
bug-1915678-901a6bd24ecede72.yaml Avoid unhandled exceptions during connecting to iSCSI portals 2021-06-17 13:00:55 +00:00
bug-1924652-2323f905f62ef8ba.yaml multipath/iscsi: remove devices from multipath monitoring 2021-04-29 18:27:45 +02:00
bug-1944474-55c5ebb3a37801aa.yaml multipath/iscsi: iSCSI connections are not reinitiated after reboot 2022-06-08 04:22:45 +00:00
delay-legacy-encryption-provider-name-deprecation-c0d07be3f0d92afd.yaml encryptors: Delay removal of legacy provider names 2017-05-16 08:27:12 +00:00
deprecate-plain-cryptsetup-encryptor-0a279abc0b0d718c.yaml encryptors: Deprecate the CryptsetupEncryptor 2019-08-22 18:23:08 -04:00
disconnect-multipath-cfg-changed-637abc5ecf44fb10.yaml iSCSI: Fix flushing after multipath cfg change 2021-03-31 15:06:13 +02:00
external-locks-9f015988ebdc37d6.yaml Use file locks in connectors 2022-06-21 16:29:25 +09:00
fc-always-check-single-wwnn-1595689da0eb673b.yaml FC: Ignore some HBAs from map for single WWNN 2019-05-09 18:55:52 +02:00
fc-flush-single-path-22ed6cc7b56a6d9b.yaml FC: Fix not flushing on detach 2021-02-24 16:40:59 +01:00
fix-fc-scan-too-broad-3c576e1846b7f05f.yaml Fix FC scan too broad 2019-11-14 15:41:30 +01:00
fix-multipath-disconnect-819d01e6e981883e.yaml Fix multipath disconnect with path failure 2018-08-13 11:02:01 +02:00
improve-get_sysfs_wwn-df38ea88cdcdcc94.yaml Improve WWN detection 2020-08-28 13:07:48 +02:00
improve-iscsi-multipath-detection-f36f28a993f61936.yaml iSCSI detect multipath DM with no WWN 2020-09-01 17:15:58 +02:00
introduce-encryption-provider-constants-a7cd0ce58da2bae8.yaml encryptors: Introduce encryption provider constants 2017-01-10 12:11:35 +00:00
iscsi_manual_scan_support-d64a1c3c8e1986b4.yaml Add open-iscsi manual scan support 2017-06-16 16:09:35 +02:00
local-attach-in-rbd-connector-c06347fb164b084a.yaml Local attach feature in RBD connector 2016-07-26 18:37:14 +00:00
multipath-improvements-596c2c6eadfba6ea.yaml Add missing release notes 2016-02-14 10:32:06 -06:00
nvme-rsd-support-d487afd77c534fa1.yaml Support RSD scenario of nvme connector 2018-12-24 13:51:20 +08:00
refactor_iscsi_connect-dfbb24305a954783.yaml Refactor iSCSI connect 2017-06-16 16:09:35 +02:00
refactor_iscsi_disconnect-557f4173bc1ae4ed.yaml Refactor iSCSI disconnect 2017-05-31 15:31:20 +02:00
remove-old-constants-20021f5b30bde890.yaml Fix a typographical error in a release notes entry. 2017-11-27 14:36:49 +02:00
scaleio-extend-attached-ec44d3a72395882c.yaml Adding support to extend attached ScaleIO volumes 2018-03-19 09:05:30 -04:00
start-using-reno-23e8d5f1a30851a1.yaml Add reno for release notes management 2016-01-20 19:19:36 -06:00
veritas-hyperscale-connector-fe56cec68b1947cd.yaml os-brick connector for Veritas HyperScale 2017-04-11 17:45:34 +05:30
vmware-vmdk-connector-19e6999e6cae43cd.yaml Add connector for vmdk volumes 2016-08-09 17:23:30 +05:30
wallaby-extra-prelude-d8de88e3e11a7b9f.yaml iSCSI: Fix flushing after multipath cfg change 2021-03-31 15:06:13 +02:00