← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1695101] [NEW] DVR Router ports and gateway ports are not bound to any host and no snat namespace created

 

Public bug reported:

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.

** Affects: neutron
     Importance: Undecided
     Assignee: Swaminathan Vasudevan (swaminathan-vasudevan)
         Status: Confirmed


** Tags: l3-dvr-backlog

** Tags added: l3-dvr-backlog

** Changed in: neutron
     Assignee: (unassigned) => Swaminathan Vasudevan (swaminathan-vasudevan)

** Changed in: neutron
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1695101

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

Status in neutron:
  Confirmed

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1695101/+subscriptions


Follow ups