Metadef Resource types are not getting flushing out from DB

Bug #1943135 reported by Pranali Deore
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Opinion
Wishlist
Pranali Deore

Bug Description

The resource types are not getting deleted form database even after deleting from CLI

$ glance md-resource-type-associate my-test-for-rs-deletion --name test-resource-type-in-db
+------------+--------------------------+
| Property | Value |
+------------+--------------------------+
| created_at | 2021-09-09T12:46:18Z |
| name | test-resource-type-in-db |
| updated_at | 2021-09-09T12:46:18Z |
+------------+--------------------------+
$ glance md-resource-type-deassociate my-test-for-rs-deletion test-resource-type-in-db

$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16967
Server version: 5.7.35-0ubuntu0.18.04.1 (Ubuntu)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use glance;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from metadef_resource_types WHERE name="test-resource-type-in-db";
+------+--------------------------+-----------+---------------------+---------------------+
| id | name | protected | created_at | updated_at |
+------+--------------------------+-----------+---------------------+---------------------+
| 4 | test-resource-type-in-db | 0 | 2021-09-09 12:46:18 | 2021-09-09 12:46:18 |
+------+--------------------------+-----------+---------------------+---------------------+

The resource type needs to be deleted from the db.

Changed in glance:
assignee: nobody → Pranali Deore (pranali-deore)
Changed in glance:
importance: Undecided → Wishlist
Revision history for this message
Abhishek Kekane (abhishek-kekane) wrote (last edit ):

I think this is not a bug and by design from the beginning. If metadef_resource_types are not associated with any namespaces then they will remain in metadef_resource_types table forever.

If any resource type is associated with metadef_namespaces then new entry will be added in 'metadef_namespace_resource_types' and while de-associating it will delete the resource type from that table but keeps it in metadef_resource_types table so that if anyone wants to use that in future then that can be associated to with same or different namespace.

Same thing goes with deleting the namespace without de-associating resource-types, it will clear/delete reource-types from metadef_namespace_resource_types table but will keep it in metadef_resource_types table.

If we want to delete the resource type from the metadef_resource_types on deassociation and deleting the namespace as well then I think that will be API behavior change and requires a spec for further discussion.

Changed in glance:
status: New → Opinion
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.