DVR scheduling checks wrong port binding profile for host in live-migration

Bug #1776255 reported by Kailun Qin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Kailun Qin

Bug Description

When live-migrating, active l3 agents on compute nodes will request a router sync against DVR routers impacted by the migration. This will check for existence of dvr serviceable ports on host to further filter the router applicable to it. However, the current implementation performs a "contains" operation on the port binding profile for host which will produce a LIKE expression that tests against a match for the middle of a string value: column LIKE '%' || <host> || '%' [1]. This leads to a wrong filtering due to the sub-string match (i.e. compute-1 will match compute-10).

[1] http://docs.sqlalchemy.org/en/latest/orm/internals.html?highlight=contains#sqlalchemy.orm.attributes.QueryableAttribute.contains

Example binding profile (dict) for host:
{
  "binding:profile": {"migrating_to": "compute-1"}
}

Kailun Qin (kailun.qin)
Changed in neutron:
assignee: nobody → Kailun Qin (kailun.qin)
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/574370

Changed in neutron:
status: New → In Progress
Changed in neutron:
importance: Undecided → High
tags: added: l3-dvr-backlog pike-backport-potential queens-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/574370
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=e356345261737162aab90bf7338d931d64ae524e
Submitter: Zuul
Branch: master

commit e356345261737162aab90bf7338d931d64ae524e
Author: Kailun Qin <email address hidden>
Date: Tue Jun 12 10:22:32 2018 +0800

    Fix DVR scheduling checks wrong profile for host

    When DVR scheduling in live-migration, the current implementation in DVR
    serviceable ports checking on host performs a "contains" operation of
    sub-string match which checks the wrong port binding profile for host
    (i.e. compute-1 will also match compute-10).

    Add quotes to force an exact match of the host name in the port binding
    profile dictionary to address this issue.

    Closes-Bug: #1776255
    Change-Id: I0d2bd9b9ff0aa58a7cce1b8da2a5f21ac6b38c57
    Signed-off-by: Kailun Qin <email address hidden>

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/575857

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/575858

tags: added: neutron-proactive-backport-potential
tags: added: neutron-easy-proactive-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/queens)

Reviewed: https://review.openstack.org/575857
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=663a7926260061dbc09e924b372d278fbe17b0a9
Submitter: Zuul
Branch: stable/queens

commit 663a7926260061dbc09e924b372d278fbe17b0a9
Author: Kailun Qin <email address hidden>
Date: Tue Jun 12 10:22:32 2018 +0800

    Fix DVR scheduling checks wrong profile for host

    When DVR scheduling in live-migration, the current implementation in DVR
    serviceable ports checking on host performs a "contains" operation of
    sub-string match which checks the wrong port binding profile for host
    (i.e. compute-1 will also match compute-10).

    Add quotes to force an exact match of the host name in the port binding
    profile dictionary to address this issue.

    Closes-Bug: #1776255
    Change-Id: I0d2bd9b9ff0aa58a7cce1b8da2a5f21ac6b38c57
    Signed-off-by: Kailun Qin <email address hidden>
    (cherry picked from commit e356345261737162aab90bf7338d931d64ae524e)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/pike)

Reviewed: https://review.openstack.org/575858
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=18a2f9bf074d5335e9917dc792754bc37176f498
Submitter: Zuul
Branch: stable/pike

commit 18a2f9bf074d5335e9917dc792754bc37176f498
Author: Kailun Qin <email address hidden>
Date: Tue Jun 12 10:22:32 2018 +0800

    Fix DVR scheduling checks wrong profile for host

    When DVR scheduling in live-migration, the current implementation in DVR
    serviceable ports checking on host performs a "contains" operation of
    sub-string match which checks the wrong port binding profile for host
    (i.e. compute-1 will also match compute-10).

    Add quotes to force an exact match of the host name in the port binding
    profile dictionary to address this issue.

    Closes-Bug: #1776255
    Change-Id: I0d2bd9b9ff0aa58a7cce1b8da2a5f21ac6b38c57
    Signed-off-by: Kailun Qin <email address hidden>
    (cherry picked from commit e356345261737162aab90bf7338d931d64ae524e)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 13.0.0.0b3

This issue was fixed in the openstack/neutron 13.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 12.0.4

This issue was fixed in the openstack/neutron 12.0.4 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 11.0.6

This issue was fixed in the openstack/neutron 11.0.6 release.

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.