DVR Router ports and gateway ports are not bound to any host and no snat namespace created

Bug #1695101 reported by Swaminathan Vasudevan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Swaminathan Vasudevan

Bug Description

In the Pike cycle there were some refactoring to the DVR db classes and resource handler mixin.
This lead to the regression where it was not creating the SNAT namespace for the DVR routers if it has gateway configured.

The only namespace seen was the fipnamespace.

This was the patch set that caused the regression.
https://review.openstack.org/#/c/457592/5

On further debugging it was found that the snat ports and the distributed router ports were not host bound. The neutron was trying to bind it to a 'null' host.

The '_build_routers_list' function in the l3_dvr_db.py was not called and hence the host binding was missing.

We have seen a similar issue a while back, #1369012 (Fix KeyError on missing gw_port_host for L3 agent in DVR mode

The issue here is the order of inheritance of the classes. If the order of inheritance of the classes are messed up, then the functions that are over-ridden are not called in the right order or skipped.

So with this we have seen the same problem, where the '_build_routers_list' in the l3_db_gwmode.py was called and not the one in the 'l3_dvr_db.py' file.

This is the current order of inheritance.

class L3_NAT_with_dvr_db_mixin(l3_db.L3_NAT_db_mixin,
                               l3_attrs_db.ExtraAttributesMixin,
                               DVRResourceOperationHandler,
                              _DVRAgentInterfaceMixin):

If the order is shuffled, it works fine and here is the shuffled order.

class L3_NAT_with_dvr_db_mixin(DVRResourceOperationHandler,
                               _DVRAgentInterfaceMixin,
                               l3_attrs_db.ExtraAttributesMixin,
                               l3_db.L3_NAT_db_mixin):

This seems to fix the problem.

tags: added: l3-dvr-backlog
Changed in neutron:
assignee: nobody → Swaminathan Vasudevan (swaminathan-vasudevan)
status: New → Confirmed
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/470063

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit abe9938367f3f7cf21e5c0e42ee7b9b81b4960b0
Author: Swaminathan Vasudevan <email address hidden>
Date: Thu Jun 1 15:49:38 2017 -0700

    DVR: Fix DVR Router snat ports and gateway ports host binding issue

    DVR snat ports and gateway ports are not bound to any host
    and so we don't see the snat namespace getting created.

    The issue is the _build_routers_list in l3_dvr_db.py is not called due
    to the inheritance order.

    Change-Id: I56f9de31524aeef262cf2a78be3abf8487c21a12
    Closes-Bug: #1695101

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (master)

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

commit 73776facdcc9611b00410c43bd16e09bdfc7a7e7
Author: Kevin Benton <email address hidden>
Date: Thu Jun 15 00:25:36 2017 -0700

    Use super to make _build_routers_list safer

    This switches _build_routers_list to call 'super' in both
    of the override cases so we aren't sensitive to class ordering.

    Change-Id: I2f8b54826918280cf63d69a6d34bfc4b358b3b6a
    Related-Bug: #1695101

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

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

tags: added: neutron-proactive-backport-potential
tags: removed: neutron-proactive-backport-potential
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.