vPTG Database improvements topic

Since the Zed version has a blueprint of the v1 code based on the v2 code refactoring, this topic will discuss the v1 database improvements based on this.

For the current tacker database, we note that after executing the delete command of V2, the corresponding data will be deleted from the corresponding table, which will avoid unnecessary data redundancy.

But in the v1’s table, after executing the delete command, the code just update the deleted field of this piece of data to 1. When the amount of data is small, the efficiency of executing query commands is still relatively high, but when the amount of data is huge, it is necessary to filter out the undeleted data from tens of thousands of pieces of data, and the efficiency is greatly reduced.

I guess that when the table was originally designed, it should be consistent with other projects of openstack, because I observed that the table of other projects also updated deleted field to 1 when deleting data. However, the main function of tacker is to arrange resources. Can we no longer follow this rule, keep the table of v1 consistent with that of V2, and delete the corresponding data record directly from the database when performing the delete operation?

I think in Zed version, we can start to modify the structure of some of the v1 tables, and the corresponding delete code.

filed of DB
https://opendev.org/openstack/tacker/src/branch/master/tacker/db/db_sqlalchemy/models.py#L203
https://opendev.org/openstack/tacker/src/branch/master/tacker/db/db_sqlalchemy/models.py#L223
https://opendev.org/openstack/tacker/src/branch/master/tacker/db/db_sqlalchemy/models.py#L256
https://opendev.org/openstack/tacker/src/branch/master/tacker/db/db_sqlalchemy/models.py#L307
https://opendev.org/openstack/tacker/src/branch/master/tacker/db/db_sqlalchemy/models.py#L348

process:
delete vnf instance
https://opendev.org/openstack/tacker/src/branch/master/tacker/objects/vnf_instance.py#L87-L98
https://opendev.org/openstack/tacker/src/branch/master/tacker/api/vnflcm/v1/controller.py#L409-L418
delete subscriptions
https://opendev.org/openstack/tacker/src/branch/master/tacker/objects/vnf_lcm_subscriptions.py#L423-L432

Select a repo