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
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing