Router gateway device are repeatedly configured When ha changed

Bug #1797298 reported by hujin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
hujin

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.

Tags: l3-ha
hujin (hujin)
Changed in neutron:
assignee: nobody → hujin (hujin)
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/609587

Changed in neutron:
status: New → In Progress
Changed in neutron:
importance: Undecided → Low
tags: added: l3-ha
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit 6541304d5e4103237135f7783c82458199d61bcb
Author: hujin <email address hidden>
Date: Thu Oct 11 13:28:11 2018 +0800

    filter "updated_at" and "revision_number" in _gateway_ports_equal

    When the HA attribute of the router changes, 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 the HA attribute of the router changes, the relevant parameters
    of gateway port will be updated by ML2 agent,
    including "binding:host_id"、"updated_at" and "revison_number".
    Method "_gateway_ports_equal" removes
    only the "binding:host_id" property of the port,
    resulting in unequal results for each decision

    Change-Id: I19e024ff360611d191da2bd3bff1b86abe1a8ea1
    Closes-Bug: 1797298

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 14.0.0.0b1

This issue was fixed in the openstack/neutron 14.0.0.0b1 development milestone.

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.