[openstack-dev] [neutron][l2gw] Preventing DB out-of-sync
mbayer at redhat.com
Fri Dec 8 15:59:04 UTC 2017
On Wed, Dec 6, 2017 at 3:46 AM, Peng Liu <pliu at redhat.com> wrote:
> During working on this patch, I encounter some DB out-of-sync problem. I
> think maybe the design can be improved. Here is my thought, all comments are
see also https://review.openstack.org/#/c/490834/ which I think is
dealing with a similar (if not the same) issue.
> In plugin code, I found all the resource operations follow the pattern in
> . It is a very misleading design compare to .
> "For every action that can be taken on a resource, the mechanism driver
> exposes two methods - ACTION_RESOURCE_precommit, which is called within the
> database transaction context, and ACTION_RESOURCE_postcommit, called after
> the database transaction is complete."
> In result, if we focus on the out-of-sync between plugin DB and
> driver/backend DB:
> 1) In RPC driver, only methods Action_Resource and are implemented. Which
> means the action is token before it was written in plugin DB. In case of
> action partial succeed (especially for update case) or plugin DB operation
> failure, it will cause DB out-of-sync.
> 2) In ODL driver, only methods Action_Resource_postcommit are implemented,
> which means there is no validation in ODL level before the record is written
> in the plugin DB. In case of, ODL side failure, there is no rollback for
> plugin DB.
> So, to fix this issue is costly. Both plugin and driver sides need to be
> The other side of this issue is a period db monitor mechanism between plugin
> and drivers, and it is another story.
>  https://review.openstack.org/#/c/516256
> def Action_Resource
> with context.session.begin(subtransactions=True):
>  https://wiki.openstack.org/wiki/Neutron/ML2
> Peng Liu
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
More information about the OpenStack-dev