OVO object create raises exception NeutronDbObjectDuplicateEntry which is not handled by Retry logic

Bug #1627811 reported by Mohit Malik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Mohit Malik

Bug Description

https://github.com/openstack/neutron/blob/master/neutron/objects/base.py#L563
In the above link, Neutron OVO create raises NeutronDbObjectDuplicateEntry on seeing duplicate entries when for example we try to do multiple API calls to create AutoAllocatedTopology for a project. This needs to be handled by retrying the transaction so will need the retry logic to catch this exception here https://github.com/openstack/neutron/blob/master/neutron/db/api.py#L59

Following Test Failure can be reproduced with this bug:

tempest.api.compute.admin.test_auto_allocate_network.AutoAllocateNetworkTest.test_server_multi_create_auto_allocate[id-2e6cf129-9e28-4e8a-aaaa-045ea826b2a6]

Console Log Output:

Captured traceback:
2016-09-13 20:57:35.982634 | ~~~~~~~~~~~~~~~~~~~
2016-09-13 20:57:35.982652 | Traceback (most recent call last):
2016-09-13 20:57:35.982687 | File "tempest/api/compute/admin/test_auto_allocate_network.py", line 183, in test_server_multi_create_auto_allocate
2016-09-13 20:57:35.982704 | min_count=3)
2016-09-13 20:57:35.982726 | File "tempest/common/compute.py", line 168, in create_test_server
2016-09-13 20:57:35.982739 | % server['id'])
2016-09-13 20:57:35.982782 | File "/opt/stack/new/tempest/.tox/tempest/local/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-09-13 20:57:35.982800 | self.force_reraise()
2016-09-13 20:57:35.982837 | File "/opt/stack/new/tempest/.tox/tempest/local/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-09-13 20:57:35.982856 | six.reraise(self.type_, self.value, self.tb)
2016-09-13 20:57:35.982877 | File "tempest/common/compute.py", line 150, in create_test_server
2016-09-13 20:57:35.982896 | clients.servers_client, server['id'], wait_until)
2016-09-13 20:57:35.982929 | File "tempest/common/waiters.py", line 75, in wait_for_server_status
2016-09-13 20:57:35.982941 | server_id=server_id)
2016-09-13 20:57:35.982973 | tempest.exceptions.BuildErrorException: Server b310365a-3db3-4a7a-a8fa-ffab9ba8c25f failed to build and is in ERROR status
2016-09-13 20:57:35.983389 | Details: {u'code': 500, u'message': u'Build of instance b310365a-3db3-4a7a-a8fa-ffab9ba8c25f aborted: Failed to allocate the network(s), not rescheduling.', u'created': u'2016-09-13T20:11:12Z'}

Neutron Service Log:

ERROR neutron.services.auto_allocate.db [req-3d2a58fe-f110-42c7-b4d5-611ee52869ea tempest-AutoAllocateNetworkTest-163226826 -] Unknown error while provisioning topology for tenant da1f1d52ca6447cb8762a22342bdf007. Reason: Failed to create a duplicate AutoAllocatedTopology: for attribute(s) ['PRIMARY'] with value(s) da1f1d52ca6447cb8762a22342bdf007

Tags: api db
Changed in neutron:
assignee: nobody → Mohit Malik (mmalik4)
status: New → In Progress
Mohit Malik (mmalik4)
Changed in neutron:
assignee: Mohit Malik (mmalik4) → nobody
assignee: nobody → Mohit Malik (mmalik4)
tags: added: api db
tags: removed: ovo
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
assignee: Mohit Malik (mmalik4) → Nakul Dahiwade (nakul-dahiwade)
Changed in neutron:
assignee: Nakul Dahiwade (nakul-dahiwade) → Mohit Malik (mmalik4)
Changed in neutron:
assignee: Mohit Malik (mmalik4) → Nakul Dahiwade (nakul-dahiwade)
Changed in neutron:
assignee: Nakul Dahiwade (nakul-dahiwade) → Mohit Malik (mmalik4)
Changed in neutron:
assignee: Mohit Malik (mmalik4) → Nakul Dahiwade (nakul-dahiwade)
Changed in neutron:
assignee: Nakul Dahiwade (nakul-dahiwade) → Mohit Malik (mmalik4)
Changed in neutron:
assignee: Mohit Malik (mmalik4) → Nakul Dahiwade (nakul-dahiwade)
Changed in neutron:
assignee: Nakul Dahiwade (nakul-dahiwade) → Mohit Malik (mmalik4)
Changed in neutron:
assignee: Mohit Malik (mmalik4) → Ihar Hrachyshka (ihar-hrachyshka)
Changed in neutron:
assignee: Ihar Hrachyshka (ihar-hrachyshka) → Mohit Malik (mmalik4)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/377084
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=17ecc54493ea29e75b8fee71e3de878c965f464d
Submitter: Jenkins
Branch: master

commit 17ecc54493ea29e75b8fee71e3de878c965f464d
Author: Mohit Malik <email address hidden>
Date: Mon Sep 26 13:25:25 2016 -0700

    Make OVO exception NeutronDbObjectDuplicateEntry retriable

    OVO object create() raises exception NeutronDbObjectDuplicateEntry
    on seeing duplicate entries which should be handled by retrying the
    transaction.

    Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
    Closes-Bug: #1627811

    Change-Id: I2b311326c2caa7500aa9318d0b5bf753cf0eb543

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

This issue was fixed in the openstack/neutron 10.0.0.0b1 development milestone.

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.