Remove SELECT ... FOR UPDATE usage from ML2 type drivers

Bug #1330562 reported by Cedric Brandily
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Cedric Brandily

Bug Description

MySQL Galera does not support SELECT ... FOR UPDATE[1], since it has no concept of cross-node locking of records and results are non-deterministic.

We should prefer to avoid SELECT ... FOR UPDATE (sqlalchemy with_lockmode method)

[1]http://lists.openstack.org/pipermail/openstack-dev/2014-May/035264.html

Tags: db ml2
Changed in neutron:
assignee: nobody → Cedric Brandily (cbrandily)
Changed in neutron:
status: New → In Progress
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/100345

Kyle Mestery (mestery)
Changed in neutron:
milestone: none → juno-2
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit dca3a8eafc5530794a0cc65c086af1db54028012
Author: Cedric Brandily <email address hidden>
Date: Mon Jun 16 22:56:10 2014 +0200

    Remove SELECT FOR UPDATE use in ML2 type driver release_segment

    SELECT FOR UPDATE expression, which is triggered with the use of the
    SQLAlchemy Query object's with_lockmode('update') method, is
    detrimental to performance and scalability of the database
    performance code in Neutron due to the lock contention it produces.

    SELECT FOR UPDATE can be entirely avoided in release_segment methods
    with the use of single-shot UPDATE and DELETE expressions, and this
    patch clears a number of uses of SELECT FOR UPDATE by consolidating
    multiple SQL expressions into one.

    Partial-Bug: #1330562
    Change-Id: I29ffcafc8d4d73ac1cb50c94df5da85514d47a3f

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

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

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

commit b3202c3283597de031572e0ede082237487d8110
Author: Cedric Brandily <email address hidden>
Date: Mon Jun 16 22:43:13 2014 +0200

    Add partial specs support in ML2 for vlan provider networks

    ML2 provider networks partial specs let admins choose some provider
    network attributes and let neutron choose remaining attributes. This
    change provides the implementation for VLAN provider networks.

    In practice, for VLAN provider networks provider:physical_network
    and provider:segmentation_id choices can be delegated to neutron,
    in such case neutron will try to find a network in tenant network
    pools which respects provided provider attributes.

    DocImpact

    Related to blueprint provider-network-partial-specs
    Partial-Bug: #1330562

    Change-Id: I2c52c71167edaa153b2e04681273e2f1be8d03aa

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

commit c9fd72a8e1c6a0b936e0c6d00285c0b9764108d5
Author: Cedric Brandily <email address hidden>
Date: Mon Jun 16 22:03:14 2014 +0200

    Add partial specs support in ML2 for gre/vxlan provider networks

    ML2 provider networks partial specs let admins choose some provider
    network attributes and let neutron choose remaining attributes. This
    change provides the implementation for GRE/VXLAN provider networks.

    In practice, for GRE/VXLAN provider networks provider:segmentation_id
    choice can be delegated to neutron, in such case neutron will try to
    find a network in tenant network pools which respects provided
    provider attributes.

    DocImpact

    Related to blueprint provider-network-partial-specs
    Partial-Bug: #1330562

    Change-Id: I720d7d04f6e3453145e888d9e4d9b5e381d0f7d4

Kyle Mestery (mestery)
Changed in neutron:
milestone: juno-2 → juno-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Cedric Brandily (<email address hidden>) on branch: master
Review: https://review.openstack.org/101982
Reason: Abandoned for the moment

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

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

commit bc4965080ce83db50b71255d6a0f972b9be67b1b
Author: Cedric Brandily <email address hidden>
Date: Tue Jul 8 00:05:21 2014 +0200

    Remove SELECT FOR UPDATE use in ML2 tunnel driver add_endpoint

    SELECT FOR UPDATE expression, which is triggered with the use of the
    SQLAlchemy Query object's with_lockmode('update') method, is
    detrimental to performance and scalability of the database
    performance code in Neutron due to the lock contention it produces.

    SELECT FOR UPDATE can be entirely avoided in add_endpoint methods
    with the use of single-shot SELECT and INSERT expressions and the
    correction of VxlanEndpoint primary key: indeed previously it was not
    possible to create multiple endpoints with the same ip, now the model
    primary key constraint ensures it.

    Change-Id: Id69fbc15c8f51b4b275cd742312e6ff6802d8c0f
    Partial-Bug: #1330562

Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-3 → juno-rc1
Shiv Haris (shh)
Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-rc1 → 2014.2
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.