Share type access references not cleaned up when share types are deleted

Bug #1870751 reported by Goutham Pacha Ravi on 2020-04-04
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Medium
Goutham Pacha Ravi

Bug Description

Steps to reproduce:

1) Create a private share type:

manila type-create private-sharetype1 False --is-public False

2) Allow project1 access to private-sharetype1

manila type-access-add private-sharetype1 {project1's UUID}

3) Delete private share type:

manila type-delete private-sharetype1

4) Log into the database and check if project access still exists:

mysql> select * from share_type_projects where share_type_id='{ID of private-sharetype1}';
+----+---------------------+------------+------------+--------------------------------------+----------------------------------+---------+
| id | created_at | updated_at | deleted_at | share_type_id | project_id | deleted |
+----+---------------------+------------+------------+--------------------------------------+----------------------------------+---------+
| 5 | 2020-04-04 09:16:38 | NULL | NULL | {ID of private-sharetype1} | {project1's UUID} | 0 |
+----+---------------------+------------+------------+--------------------------------------+----------------------------------+---------+
1 row in set (0.00 sec)

RCA: The share type deletion code does not handle cleanup for project access entries: https://opendev.org/openstack/manila/src/commit/35e82746e8a61226a456daa8ca83ee52e2300f36/manila/db/sqlalchemy/api.py#L4218-L4241

Goutham Pacha Ravi (gouthamr) wrote :

Share group types suffer from the same behavior: https://opendev.org/openstack/manila/src/commit/35e82746e8a61226a456daa8ca83ee52e2300f36/manila/db/sqlalchemy/api.py#L5079-L5101

These ghost entries cannot be cleaned up by manila or the `manila-manage db purge` tooling - will require manual intervention.

Fix proposed to branch: master
Review: https://review.opendev.org/717516

Changed in manila:
assignee: nobody → Goutham Pacha Ravi (gouthamr)
status: New → In Progress

Fix proposed to branch: master
Review: https://review.opendev.org/717646

Changed in manila:
importance: Undecided → Medium
milestone: none → ussuri-rc1

Reviewed: https://review.opendev.org/717646
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=5f80a24ff2a9e68a34e9257a1e533b5dfc8c65da
Submitter: Zuul
Branch: master

commit 5f80a24ff2a9e68a34e9257a1e533b5dfc8c65da
Author: Goutham Pacha Ravi <email address hidden>
Date: Mon Apr 6 08:52:22 2020 -0700

    Delete type access list when deleting types

    Currently we're in a foobar situation with two database
    models ShareTypeProjects and ShareGroupTypeProjects
    where we keep stuff around even when the concerned
    ShareType or ShareGroupType objects are deleted.

    So, delete type access rules when types are being deleted.

    Change-Id: Id135a96f2d1b7306156bab0ddedcb1b838a74f0a
    Closes-Bug: #1870751
    Signed-off-by: Goutham Pacha Ravi <email address hidden>

Changed in manila:
status: In Progress → Fix Released

Reviewed: https://review.opendev.org/720096
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=da38cf6194fe748edc82bcbc51bd7e8127fb15c4
Submitter: Zuul
Branch: stable/train

commit da38cf6194fe748edc82bcbc51bd7e8127fb15c4
Author: Goutham Pacha Ravi <email address hidden>
Date: Mon Apr 6 08:52:22 2020 -0700

    Delete type access list when deleting types

    Currently we're in a foobar situation with two database
    models ShareTypeProjects and ShareGroupTypeProjects
    where we keep stuff around even when the concerned
    ShareType or ShareGroupType objects are deleted.

    So, delete type access rules when types are being deleted.

    Change-Id: Id135a96f2d1b7306156bab0ddedcb1b838a74f0a
    Closes-Bug: #1870751
    Signed-off-by: Goutham Pacha Ravi <email address hidden>
    (cherry picked from commit 5f80a24ff2a9e68a34e9257a1e533b5dfc8c65da)

tags: added: in-stable-train

Reviewed: https://review.opendev.org/720210
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=995b8c3150e00ba514d86f67388bdb43637c8a15
Submitter: Zuul
Branch: stable/stein

commit 995b8c3150e00ba514d86f67388bdb43637c8a15
Author: Goutham Pacha Ravi <email address hidden>
Date: Mon Apr 6 08:52:22 2020 -0700

    Delete type access list when deleting types

    Currently we're in a foobar situation with two database
    models ShareTypeProjects and ShareGroupTypeProjects
    where we keep stuff around even when the concerned
    ShareType or ShareGroupType objects are deleted.

    So, delete type access rules when types are being deleted.

    Change-Id: Id135a96f2d1b7306156bab0ddedcb1b838a74f0a
    Closes-Bug: #1870751
    Signed-off-by: Goutham Pacha Ravi <email address hidden>
    (cherry picked from commit 5f80a24ff2a9e68a34e9257a1e533b5dfc8c65da)
    (cherry picked from commit da38cf6194fe748edc82bcbc51bd7e8127fb15c4)

tags: added: in-stable-stein

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

commit d01708ef7a500929a2f92ea99b2ba14cf789a30f
Author: Goutham Pacha Ravi <email address hidden>
Date: Mon Apr 6 08:52:22 2020 -0700

    Delete type access list when deleting types

    Currently we're in a foobar situation with two database
    models ShareTypeProjects and ShareGroupTypeProjects
    where we keep stuff around even when the concerned
    ShareType or ShareGroupType objects are deleted.

    So, delete type access rules when types are being deleted.

    Change-Id: Id135a96f2d1b7306156bab0ddedcb1b838a74f0a
    Closes-Bug: #1870751
    Signed-off-by: Goutham Pacha Ravi <email address hidden>
    (cherry picked from commit 5f80a24ff2a9e68a34e9257a1e533b5dfc8c65da)
    (cherry picked from commit da38cf6194fe748edc82bcbc51bd7e8127fb15c4)
    (cherry picked from commit 995b8c3150e00ba514d86f67388bdb43637c8a15)

tags: added: in-stable-rocky

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

commit cae5ea83effd0bf8f930b6fdf37cb60f6a4c60ca
Author: Goutham Pacha Ravi <email address hidden>
Date: Mon Apr 6 08:52:22 2020 -0700

    Delete type access list when deleting types

    Currently we're in a foobar situation with two database
    models ShareTypeProjects and ShareGroupTypeProjects
    where we keep stuff around even when the concerned
    ShareType or ShareGroupType objects are deleted.

    So, delete type access rules when types are being deleted.

    Change-Id: Id135a96f2d1b7306156bab0ddedcb1b838a74f0a
    Closes-Bug: #1870751
    Signed-off-by: Goutham Pacha Ravi <email address hidden>
    (cherry picked from commit 5f80a24ff2a9e68a34e9257a1e533b5dfc8c65da)
    (cherry picked from commit da38cf6194fe748edc82bcbc51bd7e8127fb15c4)
    (cherry picked from commit 995b8c3150e00ba514d86f67388bdb43637c8a15)
    (cherry picked from commit d01708ef7a500929a2f92ea99b2ba14cf789a30f)

tags: added: in-stable-queens
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers