plugin should support/provide *precommit methods for drivers

Bug #1557608 reported by Vishal Thapar
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Mathieu Rohon

Bug Description

BPGPVN supports lots of use cases which are not supported by different backends. Today only way for drivers to reject an unsupported use cases is to error in postcommit, at times after contacting backend, and revert db changes. This adds unnecessary performance overhead.

BGPVPN should provide precommit methods to allow such validations before data is persisted in DB.

Tags: rfe
Revision history for this message
Thomas Morin (tmmorin-orange) wrote :

See discuss:

I think the only place where code need to be added is BGPVPNDriverDBMixin (+ unit tests).

Changed in bgpvpn:
status: New → Confirmed
importance: Undecided → Medium
Changed in bgpvpn:
milestone: none → next
Revision history for this message
Mathieu Rohon (mathieu-rohon) wrote :

The most obvious precommit methods we should provide to drivers relate to bgpvpn_create/update methods. Is there any other DB related methods that need precommit hook?

Revision history for this message
Thomas Morin (tmmorin-orange) wrote :

when/if we add attributes to Network/Router associations, we may need pre_commit for these as well
additionally, a driver may support some BGPVPN parameters used for a Network association, but not for a Router association, or vice-versa

so I think we should add precommit for x_association_create/update

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to networking-bgpvpn (master)

Fix proposed to branch: master

Changed in bgpvpn:
assignee: nobody → Mathieu Rohon (mathieu-rohon)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-bgpvpn (master)

Submitter: Jenkins
Branch: master

commit 7444ff9a7f35e73009fc40e85ba817a9e418f726
Author: Mathieu Rohon <email address hidden>
Date: Mon Mar 21 16:45:41 2016 +0000

    Add precommit to the driver create/update_bgpvpn API

    With precommits, bgpvpn drivers will be able to block any change
    that a REST request wants to apply to the DB with create/update_bgpvpn.

    If the driver raises an exception during its precommit method,
    the REST client will have a HTTP 500 error, and nothing will be
    commited in the DB.

    Change-Id: I1f0e5d4a555fe0802ecc873f7ae0f2ac121fc783
    Closes-bug: 1557608

Changed in bgpvpn:
status: In Progress → Fix Released
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.