The sync_routers interface takes too long

Bug #1976345 reported by liujinxin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
In Progress
Medium
LIU Yulong

Bug Description

ENV: stable/victoria

In a large scale cloud deployment, when restart neutron l3-agent, neutron server side the _routers_to_sync interface is called twice. And this will cause the agent restart time to be too long to operate.

<_routers_to_sync> Elapsed:32.242
<_routers_to_sync> Elapsed:52.720s
<sync_routers> Elapsed:85.427s

https://github.com/openstack/neutron/blob/master/neutron/api/rpc/handlers/l3_rpc.py #128

Can it be changed to:

        if extensions.is_extension_supported(
                self.plugin, constants.PORT_BINDING_EXT_ALIAS):
            self._ensure_host_set_on_ports(context, host, routers)
            # refresh the data structure after ports are bound
            routers = self._routers_to_sync(context, router_ids, host)
        else:
            routers = self._routers_to_sync(context, router_ids, host)

Revision history for this message
LIU Yulong (dragon889) wrote :

The change looks reasonable, so please upload a patch to gerrit. Let's see if there are failures on CI pipelines.

Changed in neutron:
importance: Undecided → Medium
Revision history for this message
Brian Haley (brian-haley) wrote :

I'm not sure the proposal is valid, as the routers used in the first call to _routers_to_sync() are used inside the 'if' clause:

        routers = self._routers_to_sync(context, router_ids, host)
        if extensions.is_extension_supported(
                self.plugin, constants.PORT_BINDING_EXT_ALIAS):
            self._ensure_host_set_on_ports(context, host, routers)
            # refresh the data structure after ports are bound
            routers = self._routers_to_sync(context, router_ids, host)

Perhaps, and this is just a thought, _ensure_host_set_on_port() can return a status indicating it did some work and we can skip the second sync call if it didn't?

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

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/844172

Changed in neutron:
status: New → In Progress
Changed in neutron:
assignee: nobody → LIU Yulong (dragon889)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by "liuyulong <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/844172

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.