quota reservations can raise DBDeadlock

Bug #1193199 reported by Chris Behrens
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Chris Behrens

Bug Description

Due to how innodb works and that we do a select+insert... a couple of parallel select+inserts can raise DBDeadlock when using thread pooling:

2013-06-21 03:37:36.763 4585 TRACE nova DBDeadlock: (OperationalError) (1213, 'Deadlock found when trying to get lock; try restarting transaction') 'INSERT INTO quota_usages (created_at, updated_at, deleted_at, deleted, project_id, resource, in_use, reserved, until_refresh) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)' (datetime.datetime(2013, 6, 21, 3, 37, 36, 758605), None, None, 0, 'fake', 'cores', 0, 0, None)

Chris Behrens (cbehrens)
Changed in nova:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
assignee: nobody → Chris Behrens (cbehrens)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/33915
Committed: http://github.com/openstack/nova/commit/c0ca847286b88f37e3b4cb6b394fced4b60ed06f
Submitter: Jenkins
Branch: master

commit c0ca847286b88f37e3b4cb6b394fced4b60ed06f
Author: Chris Behrens <email address hidden>
Date: Fri Jun 21 03:41:54 2013 +0000

    Retry quota_reserve on DBDeadlock

    quota_reserve() can raise DBDeadlock... so this adds the decorator that
    retries the transaction.

    Fixes bug 1193199

    Change-Id: Id632360372b21f3e75a2af50153eb18cc2025390

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-2 → 2013.2
Revision history for this message
Matt Riedemann (mriedem) wrote :

Seeing a similar deadlock on the old side of grenade which would be stable/icehouse now:

http://logs.openstack.org/60/109660/7/check/check-grenade-dsvm-partial-ncpu/deb4b82/logs/old/screen-n-api.txt.gz#_2014-07-28_19_59_01_933

This is in a security group test but I'm not sure that matters.

Bug 1297590 seems related.

Revision history for this message
Matt Riedemann (mriedem) wrote :

Opened bug 1350064 for the grenade race.

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.