Manila allows share type deletion despite quota allocations

Bug #1811680 reported by Arne Wiebalck
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Medium
Goutham Pacha Ravi

Bug Description

Manila seems allows share type deletions when there are still per project quota allocations.

I found this when purging our Manila DB ("manila-manage db purge") and ran into a situation where the foreign key constraint on project_share_type_quotas prevents the purge of share_types.

Apart from direct DB manipulation there seems to be no way to get out of this situation.

I think Manila should do one of the following:
a) make "manila type-delete" fail if that violates a foreign key constraint (in this case if there are entries in project_share_type_quotas that reference the type to be deleted), or
b) offer a "--force" option to "manila quota-delete" to ignore non-existing types.

My preference would be a), but b) is probably easier coding-wise (and would at least avoid that operators need to directly change the database).

Tom Barron (tpb)
tags: added: db
tags: added: quotas
Changed in manila:
importance: Undecided → Medium
Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :

Hey Arne,

Do you think we should rather cleanup quota allocations when you delete a share type? I don't think we care about quotas if the type cannot be used.

Revision history for this message
Arne Wiebalck (arne-wiebalck) wrote :

Hey Goutham!

I agree, sounds like a good and simple option c) :-)

I probably thought it was intentional to force the operator to do the quota cleanup prior to a type deletion (kind of due diligence) ... what will Manila do if you try to delete a type when there are still shares around?

Thanks!
 Arne

Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :

Hi Arne,

Manila prevents deleting share types that are currently in use [1]. I'll work on this quotas bug post M3.

[1] https://github.com/openstack/manila/blob/5391830/manila/db/sqlalchemy/api.py#L4006

Changed in manila:
assignee: nobody → Goutham Pacha Ravi (gouthamr)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

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

Changed in manila:
status: New → In Progress
Changed in manila:
milestone: none → stein-3
tags: added: backport-potential
Tom Barron (tpb)
Changed in manila:
milestone: stein-3 → stein-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/643516
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=4b6cfcf69023dc7a4b004c59513c50d92b979152
Submitter: Zuul
Branch: master

commit 4b6cfcf69023dc7a4b004c59513c50d92b979152
Author: Goutham Pacha Ravi <email address hidden>
Date: Fri Mar 15 00:07:32 2019 -0700

    Destroy type quotas when a share type is deleted

    Upon share type deletion, we were leaving behind
    share type quotas, usages and reservations. These
    couldn't be cleaned up without resorting to manual
    intervention.

    Cleanup quotas when a share type is being destroyed,
    since the resources that they pertained to are gone
    too.

    Closes-Bug: #1811680
    Change-Id: I04b1fe88808596aa8c05429b964190d654587f9a

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

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/644374

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

Reviewed: https://review.openstack.org/644374
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=aae7bc723591728c6be2a500ca44af8e6a032268
Submitter: Zuul
Branch: stable/rocky

commit aae7bc723591728c6be2a500ca44af8e6a032268
Author: Goutham Pacha Ravi <email address hidden>
Date: Fri Mar 15 00:07:32 2019 -0700

    Destroy type quotas when a share type is deleted

    Upon share type deletion, we were leaving behind
    share type quotas, usages and reservations. These
    couldn't be cleaned up without resorting to manual
    intervention.

    Cleanup quotas when a share type is being destroyed,
    since the resources that they pertained to are gone
    too.

    Closes-Bug: #1811680
    Change-Id: I04b1fe88808596aa8c05429b964190d654587f9a
    (cherry picked from commit 4b6cfcf69023dc7a4b004c59513c50d92b979152)

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

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/644585

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

Reviewed: https://review.openstack.org/644585
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=c9f954119391770899a68372bb0bd2829fc9b3c2
Submitter: Zuul
Branch: stable/queens

commit c9f954119391770899a68372bb0bd2829fc9b3c2
Author: Goutham Pacha Ravi <email address hidden>
Date: Fri Mar 15 00:07:32 2019 -0700

    Destroy type quotas when a share type is deleted

    Upon share type deletion, we were leaving behind
    share type quotas, usages and reservations. These
    couldn't be cleaned up without resorting to manual
    intervention.

    Cleanup quotas when a share type is being destroyed,
    since the resources that they pertained to are gone
    too.

    Closes-Bug: #1811680
    Change-Id: I04b1fe88808596aa8c05429b964190d654587f9a
    (cherry picked from commit 4b6cfcf69023dc7a4b004c59513c50d92b979152)
    (cherry picked from commit aae7bc723591728c6be2a500ca44af8e6a032268)

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

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/644877

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

Reviewed: https://review.openstack.org/644877
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=79a96fc559d82e8b51b2e0eabca5cfe03374c69f
Submitter: Zuul
Branch: stable/pike

commit 79a96fc559d82e8b51b2e0eabca5cfe03374c69f
Author: Goutham Pacha Ravi <email address hidden>
Date: Fri Mar 15 00:07:32 2019 -0700

    Destroy type quotas when a share type is deleted

    Upon share type deletion, we were leaving behind
    share type quotas, usages and reservations. These
    couldn't be cleaned up without resorting to manual
    intervention.

    Cleanup quotas when a share type is being destroyed,
    since the resources that they pertained to are gone
    too.

    Closes-Bug: #1811680
    Change-Id: I04b1fe88808596aa8c05429b964190d654587f9a
    (cherry picked from commit 4b6cfcf69023dc7a4b004c59513c50d92b979152)
    (cherry picked from commit aae7bc723591728c6be2a500ca44af8e6a032268)
    (cherry picked from commit c9f954119391770899a68372bb0bd2829fc9b3c2)

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

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

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

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

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

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

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

This issue was fixed in the openstack/manila 5.1.0 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.