Filtering shares by extra-specs provides wrong results

Bug #1929121 reported by Goutham Pacha Ravi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Low
Kafilat Adeleke

Bug Description

Description
===========
It's possible to use share type "extra_specs" as key=value pairs to filter shares by. However, this doesn't seem to work as intended.

Steps to reproduce
==================

1) Create a share type, set some extra-specs - for example: snapshot_support=True
2) Create another share type, set the opposite value to the extra spec chosen above, example: snapshot_support=False
3) Create a few shares of that share type
4) Filter the share by extra specs

Manila CLI Commands:
$ manila type-create typeX False --snapshot-support True
$ manila type-create typeY False --snapshot-support False
$ manila create nfs 1 --share-type typeX --name typeXShare
$ manila create nfs 2 --share-type typeY --name typeYShare
$ manila list --extra-specs snapshot_support=True

Expected result
===============
Only shares matching the share type that has the extra-specs requested are retrieved by the API call

Actual result
=============
All shares matching any share type that have the extra-spec key or value are retrieved by the API

Example: http://paste.openstack.org/show/805523/

Environment
===========
1. Running manila from the trunk/development branch
2. This isn't just a CLI issue, the issue is reproducible directly using CURL on the API as well.

Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :
tags: added: api
Changed in manila:
importance: Undecided → Low
tags: added: low-hanging-fruit
Changed in manila:
milestone: none → xena-2
assignee: nobody → Kafilat Adeleke (kafilat-adeleke)
status: New → Confirmed
Changed in manila:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.opendev.org/c/openstack/manila/+/795256
Committed: https://opendev.org/openstack/manila/commit/4fbacf1df1dbe7a85726e22892d462b5b7c4e316
Submitter: "Zuul (22348)"
Branch: master

commit 4fbacf1df1dbe7a85726e22892d462b5b7c4e316
Author: Kafilat Adeleke <email address hidden>
Date: Tue Jun 8 08:27:44 2021 +0000

    Filter shares by share type "extra_specs"

    This change fixes the query being used to filter share
    types. We were using an "or" clause instead of an "and" clause,
    and that was causing all the extra specs to be shown instead of
    the ones that the user specified. With this fix, manila users will
    be able to filter shares by share type extra_specs accurately.

    Closes-Bug: #1929121

    Change-Id: I5cf9788dcafebdf88426617d2824f4be42dbb412

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

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/manila/+/799775

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

Reviewed: https://review.opendev.org/c/openstack/manila/+/799775
Committed: https://opendev.org/openstack/manila/commit/59a0c147df9e9255b3199fbb6846311f0fe8cef1
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 59a0c147df9e9255b3199fbb6846311f0fe8cef1
Author: Kafilat Adeleke <email address hidden>
Date: Tue Jun 8 08:27:44 2021 +0000

    Filter shares by share type "extra_specs"

    This change fixes the query being used to filter share
    types. We were using an "or" clause instead of an "and" clause,
    and that was causing all the extra specs to be shown instead of
    the ones that the user specified. With this fix, manila users will
    be able to filter shares by share type extra_specs accurately.

    Closes-Bug: #1929121

    Change-Id: I5cf9788dcafebdf88426617d2824f4be42dbb412
    (cherry picked from commit 4fbacf1df1dbe7a85726e22892d462b5b7c4e316)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/manila/+/799915

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

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/manila/+/804724

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

Reviewed: https://review.opendev.org/c/openstack/manila/+/799915
Committed: https://opendev.org/openstack/manila/commit/21d5b1b209e6f45b9e689223c4d310dd4ed49b01
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit 21d5b1b209e6f45b9e689223c4d310dd4ed49b01
Author: Kafilat Adeleke <email address hidden>
Date: Tue Jun 8 08:27:44 2021 +0000

    Filter shares by share type "extra_specs"

    This change fixes the query being used to filter share
    types. We were using an "or" clause instead of an "and" clause,
    and that was causing all the extra specs to be shown instead of
    the ones that the user specified. With this fix, manila users will
    be able to filter shares by share type extra_specs accurately.

    Closes-Bug: #1929121

    Change-Id: I5cf9788dcafebdf88426617d2824f4be42dbb412
    (cherry picked from commit 4fbacf1df1dbe7a85726e22892d462b5b7c4e316)
    (cherry picked from commit 59a0c147df9e9255b3199fbb6846311f0fe8cef1)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/manila/+/804724
Committed: https://opendev.org/openstack/manila/commit/d57958a1eac38b045495abbb371f18591f4cb30b
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit d57958a1eac38b045495abbb371f18591f4cb30b
Author: Kafilat Adeleke <email address hidden>
Date: Tue Jun 8 08:27:44 2021 +0000

    Filter shares by share type "extra_specs"

    This change fixes the query being used to filter share
    types. We were using an "or" clause instead of an "and" clause,
    and that was causing all the extra specs to be shown instead of
    the ones that the user specified. With this fix, manila users will
    be able to filter shares by share type extra_specs accurately.

    Closes-Bug: #1929121

    Change-Id: I5cf9788dcafebdf88426617d2824f4be42dbb412
    (cherry picked from commit 4fbacf1df1dbe7a85726e22892d462b5b7c4e316)
    (cherry picked from commit 59a0c147df9e9255b3199fbb6846311f0fe8cef1)
    (cherry picked from commit 21d5b1b209e6f45b9e689223c4d310dd4ed49b01)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/c/openstack/manila/+/806524

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

This issue was fixed in the openstack/manila 13.0.0.0rc1 release candidate.

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

Reviewed: https://review.opendev.org/c/openstack/manila/+/806524
Committed: https://opendev.org/openstack/manila/commit/864ca2d6b57c6e6277817f6e59ecf3db9e9bdd5f
Submitter: "Zuul (22348)"
Branch: stable/train

commit 864ca2d6b57c6e6277817f6e59ecf3db9e9bdd5f
Author: Kafilat Adeleke <email address hidden>
Date: Tue Jun 8 08:27:44 2021 +0000

    Filter shares by share type "extra_specs"

    This change fixes the query being used to filter share
    types. We were using an "or" clause instead of an "and" clause,
    and that was causing all the extra specs to be shown instead of
    the ones that the user specified. With this fix, manila users will
    be able to filter shares by share type extra_specs accurately.

    Closes-Bug: #1929121

    Change-Id: I5cf9788dcafebdf88426617d2824f4be42dbb412
    (cherry picked from commit 4fbacf1df1dbe7a85726e22892d462b5b7c4e316)
    (cherry picked from commit 59a0c147df9e9255b3199fbb6846311f0fe8cef1)
    (cherry picked from commit 21d5b1b209e6f45b9e689223c4d310dd4ed49b01)
    (cherry picked from commit d57958a1eac38b045495abbb371f18591f4cb30b)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 12.1.0

This issue was fixed in the openstack/manila 12.1.0 release.

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

This issue was fixed in the openstack/manila 11.1.0 release.

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

This issue was fixed in the openstack/manila 10.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila train-eol

This issue was fixed in the openstack/manila train-eol release.

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.