Use db unique index to control duplicate name for NFV resources

Bug #1667641 reported by yong sheng gong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
High
Kanagaraj Manickam

Bug Description

Problem:
Currently, we are using python code to avoid name duplication of a certain resource type:
such as:
https://github.com/openstack/tacker/blob/master/tacker/vnfm/plugin.py#L154
        if self._get_by_name(context, vnfm_db.VNFD, name):
            raise exceptions.DuplicateResourceName(resource='VNFD', name=name)

this cannot work if there are multiple tacker servers running where the race condition will happen.

solution:
    to use unique index on tenant_id and name columns of the NFV resources.

Changed in tacker:
milestone: none → pike-1
Changed in tacker:
importance: Undecided → High
tags: added: multi-services
Changed in tacker:
assignee: nobody → Kanagaraj Manickam (kanagaraj-manickam)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (master)

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

Changed in tacker:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (master)

Reviewed: https://review.openstack.org/439719
Committed: https://git.openstack.org/cgit/openstack/tacker/commit/?id=8b517c0029af1390717726ebe77aefc4ad5a2012
Submitter: Jenkins
Branch: master

commit 8b517c0029af1390717726ebe77aefc4ad5a2012
Author: Kanagaraj Manickam <email address hidden>
Date: Wed Mar 1 12:52:49 2017 +0530

    Adds unique constraint on name and tenant_id

    Update the schema for VIM, VNFD, VNF, NS and NSD tables
    to constraint the name per tenant as unique.

    Change-Id: I463fe02ebd4b0f720260bda1c3da4cdebc6ec238
    Closes-bug: #1667641

Changed in tacker:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tacker 0.8.0

This issue was fixed in the openstack/tacker 0.8.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tacker (master)

Change abandoned by "Kanagaraj Manickam <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/tacker/+/450528

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.