Lock wait timeout updating ipavailabilityranges

Bug #1334226 reported by Eugene Nikanorov
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
neutron
Expired
Medium
Unassigned

Bug Description

Note that this is different from bug https://bugs.launchpad.net/neutron/+bug/1330638

Traceback:
 neutron.api.v2.resource Traceback (most recent call last):
 neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/api/v2/resource.py", line 87, in resource
 neutron.api.v2.resource result = method(request=request, **args)
 neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/api/v2/base.py", line 447, in create
 neutron.api.v2.resource obj = obj_creator(request.context, **kwargs)
 neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/l3_db.py", line 148, in create_router
 neutron.api.v2.resource self._update_router_gw_info(context, router_db['id'], gw_info)
 neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/l3_gwmode_db.py", line 58, in _update_router_gw_info
 neutron.api.v2.resource context, router_id, info, router=router)
 neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/l3_db.py", line 316, in _update_router_gw_info
 neutron.api.v2.resource self._create_gw_port(context, router_id, router, network_id)
 neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/l3_db.py", line 306, in _create_gw_port
 neutron.api.v2.resource self._create_router_gw_port(context, router, new_network)
 neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/l3_db.py", line 255, in _create_router_gw_port
 neutron.api.v2.resource 'name': ''}})
 neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/plugins/ml2/plugin.py", line 644, in create_port
 neutron.api.v2.resource result = super(Ml2Plugin, self).create_port(context, port)
 neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/db_base_plugin_v2.py", line 1464, in create_port
 neutron.api.v2.resource context.session.add(allocated)
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 463, in __exit__
 neutron.api.v2.resource self.rollback()
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 57, in __exit__
 neutron.api.v2.resource compat.reraise(exc_type, exc_value, exc_tb)
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 460, in __exit__
 neutron.api.v2.resource self.commit()
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 370, in commit
 neutron.api.v2.resource self._prepare_impl()
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 350, in _prepare_impl
 neutron.api.v2.resource self.session.flush()
 neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/openstack/common/db/sqlalchemy/session.py", line 439, in _wrap
 neutron.api.v2.resource return f(self, *args, **kwargs)
 neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/openstack/common/db/sqlalchemy/session.py", line 705, in flush
 neutron.api.v2.resource return super(Session, self).flush(*args, **kwargs)
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1907, in flush
 neutron.api.v2.resource self._flush(objects)
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 2025, in _flush
 neutron.api.v2.resource transaction.rollback(_capture_exception=True)
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 57, in __exit__
 neutron.api.v2.resource compat.reraise(exc_type, exc_value, exc_tb)
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1989, in _flush
 neutron.api.v2.resource flush_context.execute()
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 371, in execute
 neutron.api.v2.resource rec.execute(self)
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 524, in execute
 neutron.api.v2.resource uow
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 59, in save_obj
 neutron.api.v2.resource mapper, table, update)
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 516, in _emit_update_statements
 neutron.api.v2.resource execute(statement, params)
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 727, in execute
 neutron.api.v2.resource return meth(self, multiparams, params)
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 322, in _execute_on_connection
 neutron.api.v2.resource return connection._execute_clauseelement(self, multiparams, params)
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 824, in _execute_clauseelement
 neutron.api.v2.resource compiled_sql, distilled_params
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 954, in _execute_context
 neutron.api.v2.resource context)
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1116, in _handle_dbapi_exception
 neutron.api.v2.resource exc_info
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 189, in raise_from_cause
 neutron.api.v2.resource reraise(type(exception), exception, tb=exc_tb)
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 947, in _execute_context
 neutron.api.v2.resource context)
 neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 435, in do_execute
 neutron.api.v2.resource cursor.execute(statement, parameters)
 neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
 neutron.api.v2.resource self.errorhandler(self, exc, value)
 neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
 neutron.api.v2.resource raise errorclass, errorvalue
 neutron.api.v2.resource OperationalError: (OperationalError) (1205, 'Lock wait timeout exceeded; try restarting transaction') 'UPDATE ipavailabilityranges SET first_ip=%s WHERE ipavailabilityranges.allocation_pool_id = %s AND ipavailabilityranges.first_ip = %s AND ipavailabilityranges.last_ip = %s' ('172.24.4.52', 'd622315c-3c96-48b0-a1ba-9e089fff4ae4', '172.24.4.51', '172.24.4.254')

http://logs.openstack.org/22/101522/5/check/check-tempest-dsvm-neutron-full/7a21846/logs/screen-q-svc.txt.gz?level=TRACE#_2014-06-24_07_12_13_603

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/108945

Changed in neutron:
assignee: nobody → Eugene Nikanorov (enikanorov)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/108945
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=267509143957f73e42f6550ce93fca6248c721d8
Submitter: Jenkins
Branch: master

commit 267509143957f73e42f6550ce93fca6248c721d8
Author: Eugene Nikanorov <email address hidden>
Date: Wed Jul 23 14:14:00 2014 +0400

    Move loadbalancer vip port creation outside of transaction

    Currently _create_port_for_vip calls ml2 create_port() method
    which includes rpc notification.
    That leads to lock wait timeouts in certain cases.

    The patch fixes that while making VIP creation process non-atomic.
    But that is fine as long until create_vip() returns vip id, it's
    not usable from API.

    Change-Id: Ie30973de80118a6b022e8c3bb07ca48122ebcd29
    Partial-Bug: #1334226

Changed in neutron:
importance: High → Medium
Revision history for this message
Eugene Nikanorov (enikanorov) wrote :

Marking as Incomplete until new hits of this issue are discovered on master

Changed in neutron:
assignee: Eugene Nikanorov (enikanorov) → nobody
Changed in neutron:
status: In Progress → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for neutron because there has been no activity for 60 days.]

Changed in neutron:
status: Incomplete → Expired
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.