Quota Deadlock when creating >200 servers at once under Psql

Bug #1270725 reported by wingwj
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Unassigned
oslo-incubator
Fix Released
Medium
wingwj

Bug Description

When you create >200 servers at once under psql,
  it's easier to meet a deadlock exception in quota process(reserve/commit).

Like this:
http://paste.openstack.org/show/61534/

The '@retry_on_dead_lock' function, is not available for matching psql.

wingwj (wingwj)
tags: added: db deadlock
wingwj (wingwj)
Changed in nova:
assignee: nobody → wingwj (wingwj)
summary: - Quota Deadlock when creating >200 servers at once under psql
+ Quota Deadlock when creating >200 servers at once under Psql
Revision history for this message
Rui Chen (kiwik-chenrui) wrote :

If error message is matched, raw DB error will be transformed to nova DBDeadlock.

there is only mysql regex string, no postgresql.

_DEADLOCK_RE_DB = {
    "mysql": re.compile(r"^.*\(1213, 'Deadlock.*")
}

look like a bug.

Joe Gordon (jogo)
Changed in nova:
status: New → Confirmed
milestone: none → icehouse-3
Revision history for this message
wingwj (wingwj) wrote :

I'll add the psql support in @retry_on_deadlock, and test the issue again. Thanks~

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

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
wingwj (wingwj) wrote :

Link to oslo patch

Changed in oslo:
assignee: nobody → wingwj (wingwj)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo-incubator (master)

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

Changed in oslo:
status: New → In Progress
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-3 → icehouse-rc1
Tracy Jones (tjones-i)
Changed in nova:
importance: Undecided → High
Changed in nova:
milestone: icehouse-rc1 → none
tags: added: icehouse-rc-potential
removed: deadlock
Thierry Carrez (ttx)
tags: added: icehouse-backport-potential
removed: icehouse-rc-potential
Revision history for this message
Matt Riedemann (mriedem) wrote :
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix proposed to oslo.db (master)

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

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote :

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

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote :

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

Revision history for this message
sean mooney (sean-k-mooney) wrote :

i belive this bug also impacts neutron and cinder

see bugs below

https://bugs.launchpad.net/neutron/+bug/1333084
https://bugs.launchpad.net/cinder/+bug/1294855

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.db (master)

Reviewed: https://review.openstack.org/92001
Committed: https://git.openstack.org/cgit/openstack/oslo.db/commit/?id=3a6a5b01a72e0e20787f3d6a47f6f0c0262dbbeb
Submitter: Jenkins
Branch: master

commit 3a6a5b01a72e0e20787f3d6a47f6f0c0262dbbeb
Author: wingwj <email address hidden>
Date: Sun May 4 15:43:47 2014 +0800

    Add _wrap_db_error support for postgresql

    The original "_wrap_db_error" function is only available for mysql.
    We need to add support for postgresql.

    The deadlock exception thrown from postgresql is TransactionRollbackError,
    it's not the same with "OperationalError" thrown from mysql,
    and isn't included in sqlalchemy. So, the base exception need to be
    catched.

    Change-Id: I439a4e0c431c9446ffabd1c93f11b8f509b1ebd7
    Closes-Bug: #1270725

Changed in oslo:
status: In Progress → Fix Committed
Changed in oslo:
importance: Undecided → Medium
Changed in oslo:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo-incubator (master)

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

Revision history for this message
Jay Pipes (jaypipes) wrote :

wingwj,

Pavel Kholkin has been working on refactoring the quota DB code to remove the use of SELECT FOR UPDATE (which triggers this behaviour behind the scenes in both MySQL and PostgreSQL).

If you are not currently working on this bug, can I transfer ownership of the bug (and bug 1283987) to Pavel?

Please let me know at your earliest!
-jay

Revision history for this message
Sean Dague (sdague) wrote :

Does not appear to be in progress in Nova

Changed in nova:
status: In Progress → Confirmed
assignee: wingwj (wingwj) → nobody
Revision history for this message
Joe Gordon (jogo) wrote :

Looks like this should be fixed in nova since the fix landed in oslo

Changed in nova:
status: Confirmed → Fix Released
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.