rbd: "error updating features for image" when enabling multi-attach

Bug #1997980 reported by Mikolaj Golub
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Eric Harney

Bug Description

In the rbd driver, when enabling multiattach it tries to disable some rbd image features (which are in MULTIATTACH_EXCLUSIONS list) [1]. If the image does not have any of these features (like in the case when it was created with rbd_default_features = 3), it still tries to call "update_features" librbd function with "changed_features = 0". And the librbd does not like this, considering this as invalid [2].

As a result it fails with an error like below:

  [errno 22] RBD invalid argument (error updating features for image b'volume-f664bb1c-7217-4c5a-8867-b36766afcde6')

The fix could be just to skip calling librbd's `update_feature` if there is nothing to update ("changed_features" is 0). (And the same should be done in _disable_multiattach).

[1] https://github.com/openstack/cinder/blob/24f43918eacad6db89d613d11f9cd7f796208e9c/cinder/volume/drivers/rbd.py#L952
[2] https://github.com/ceph/ceph/blob/2a9fac2cc4b10af04c52e12f34932e6d2d91441f/src/librbd/Operations.cc#L1503

Tags: drivers rbd
description: updated
description: updated
Eric Harney (eharney)
Changed in cinder:
assignee: nobody → Eric Harney (eharney)
importance: Undecided → Medium
tags: added: drivers rbd
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/cinder/+/865855

Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.opendev.org/c/openstack/cinder/+/865855
Committed: https://opendev.org/openstack/cinder/commit/6e08f15074baa608d238959aa8f3fd6c9838ad7d
Submitter: "Zuul (22348)"
Branch: master

commit 6e08f15074baa608d238959aa8f3fd6c9838ad7d
Author: Eric Harney <email address hidden>
Date: Mon Nov 28 09:26:18 2022 -0500

    RBD: Skip update_features when features = 0

    librbd errors when update_features is called w/
    features = 0 -- when this situation would occur,
    skip calling update_features.

    Closes-Bug: #1997980
    Change-Id: Iab6a990ce7dee2c13deb4f46aeec0f46ffb7cd62

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/2023.1)

Fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/cinder/+/881435

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/2023.1)

Reviewed: https://review.opendev.org/c/openstack/cinder/+/881435
Committed: https://opendev.org/openstack/cinder/commit/efd74240978cbbe10f547cc188a9a461c0fb5b5d
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit efd74240978cbbe10f547cc188a9a461c0fb5b5d
Author: Eric Harney <email address hidden>
Date: Mon Nov 28 09:26:18 2022 -0500

    RBD: Skip update_features when features = 0

    librbd errors when update_features is called w/
    features = 0 -- when this situation would occur,
    skip calling update_features.

    Closes-Bug: #1997980
    Change-Id: Iab6a990ce7dee2c13deb4f46aeec0f46ffb7cd62
    (cherry picked from commit 6e08f15074baa608d238959aa8f3fd6c9838ad7d)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 22.1.1

This issue was fixed in the openstack/cinder 22.1.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 23.0.0.0rc1

This issue was fixed in the openstack/cinder 23.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/zed)

Fix proposed to branch: stable/zed
Review: https://review.opendev.org/c/openstack/cinder/+/908690

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.