network creation error but it is recorded at neutron DB side.

Bug #1529326 reported by Li Ma on 2015-12-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DragonFlow
High
Li Ma

Bug Description

Here is the problem:

A network is created and written in neutron DB. At the meantime, Etcd cannot get the corresponding key 'lswitch', which causes unable to create subnet for this network.

The log file says that Etcd was disconnected at the network creation.

AFAIK, if the operation on Etcd fails, the DB transaction should also be rollbacked at the neutron DB side to prevent from updating DB records. This causes inconsistency of DB backends.

The related code in dragonflow/neutron/plugin.py:

def create_network(self, context, network):
        with context.session.begin(subtransactions=True):
            result = super(DFPlugin, self).create_network(context,
                                                          network)
            self._process_l3_create(context, result, network['network'])

        return self.create_network_nb_api(result)

Li Ma (nick-ma-z) on 2015-12-26
description: updated
description: updated
Changed in dragonflow:
assignee: nobody → Li Ma (nick-ma-z)
Li Ma (nick-ma-z) wrote :

It is easy to reproduce.

1. kill etcd
2. run 'neutron net-create network11'
3. It shows neutron cannot create network.
4. run 'neutron net-list'

Li Ma (nick-ma-z) on 2015-12-28
Changed in dragonflow:
assignee: Li Ma (nick-ma-z) → nobody
Gal Sagie (gal-sagie) on 2015-12-29
Changed in dragonflow:
importance: Undecided → High
Li Ma (nick-ma-z) on 2015-12-30
Changed in dragonflow:
assignee: nobody → Li Ma (nick-ma-z)

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

Changed in dragonflow:
status: New → In Progress

Change abandoned by Li Ma (<email address hidden>) on branch: master
Review: https://review.openstack.org/262423
Reason: a new spec is proposed.

Yuli (stremovsky) wrote :

This bug is replaced with the DB consistency and reliability specs. Can this bug be closed as invalid? Is there a duplicate?

Reviewed: https://review.openstack.org/282290
Committed: https://git.openstack.org/cgit/openstack/dragonflow/commit/?id=3b92dc8eac33ad96b6cd40ad80427c9951444d99
Submitter: Jenkins
Branch: master

commit 3b92dc8eac33ad96b6cd40ad80427c9951444d99
Author: Li Ma <email address hidden>
Date: Thu Feb 18 10:30:42 2016 +0800

    Implement DB consistency

    It is a distributed lock based on SQL. Each lock is
    associated with a Neutron project(tenant) and a given
    API session. It ensures that a lock is acquired and
    released in the same API context.

    The detailed description is in the spec review.
    https://review.openstack.org/268005

    Closes-Bug: #1529812
    Closes-Bug: #1529326
    Closes-Bug: #1497676
    Related-Bug: #1527234
    Implements: blueprint bp/keep-db-consistency

    Change-Id: Iff916481282f2d60df66c0e916f3045f9944531e

Changed in dragonflow:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers