← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1797298] [NEW] Router gateway device are repeatedly configured When ha changed

 

Public bug reported:

When the router ha changed, the code determines whether the gateway in
memory is consistent with the gateway in the database to decide whether
it needs to be reconfigured. But there are problems with the judging
conditions.

After router HA changed, the relevant parameters of gateway port will be
updated by ML2 agent, including binding_host and updated_at.

The code of ha_router, method _gateway_ports_equal removes only the
binding_host property of the port, resulting in unequal results for each
decision

@staticmethod
    def _gateway_ports_equal(port1, port2):
        def _get_filtered_dict(d, ignore):
            return {k: v for k, v in d.items() if k not in ignore}

        keys_to_ignore = set([portbindings.HOST_ID])
        port1_filtered = _get_filtered_dict(port1, keys_to_ignore)
        port2_filtered = _get_filtered_dict(port2, keys_to_ignore)
        return port1_filtered == port2_filtered

So every time ha switches, the gateway is reconfigured.

** Affects: neutron
     Importance: Undecided
         Status: New

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

Title:
  Router gateway device are repeatedly configured When ha changed

Status in neutron:
  New

Bug description:
  When the router ha changed, the code determines whether the gateway in
  memory is consistent with the gateway in the database to decide
  whether it needs to be reconfigured. But there are problems with the
  judging conditions.

  After router HA changed, the relevant parameters of gateway port will
  be updated by ML2 agent, including binding_host and updated_at.

  The code of ha_router, method _gateway_ports_equal removes only the
  binding_host property of the port, resulting in unequal results for
  each decision

  @staticmethod
      def _gateway_ports_equal(port1, port2):
          def _get_filtered_dict(d, ignore):
              return {k: v for k, v in d.items() if k not in ignore}

          keys_to_ignore = set([portbindings.HOST_ID])
          port1_filtered = _get_filtered_dict(port1, keys_to_ignore)
          port2_filtered = _get_filtered_dict(port2, keys_to_ignore)
          return port1_filtered == port2_filtered

  So every time ha switches, the gateway is reconfigured.

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


Follow ups