Public bug reported:

When virtual router bind to L3 agent (router migration or create new),
synchronization function sync_routers() try get MTU for all router
interfaces by network IDs. This process run in function
'_get_mtus_by_network_list' in l3_db.py file. But, when is formed
database query, incorrect filters are passed in lines
(https://github.com/openstack/neutron/blob/master/neutron/db/l3_db.py#L1719):

```
filters = {'network_id': network_ids}
fields = ['id', 'mtu']
networks = self._core_plugin.get_networks(context, filters=filters, 
fields=fields)
```

The mistake is that resource 'network' doesn't have field 'network_id',
he have field 'id'. As a result, runs for a few seconds on the big
database. This slows down the router migration operation for a few
seconds.

To fix, you need to pass a filter by 'id' field.

** Affects: neutron
     Importance: Undecided
     Assignee: Vadim Ponomarev (velizarx)
         Status: In Progress

** Changed in: neutron
       Status: New => In Progress

** Changed in: neutron
     Assignee: (unassigned) => Vadim Ponomarev (velizarx)

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

Title:
  Incorrect database query when get mtu for network list

Status in neutron:
  In Progress

Bug description:
  When virtual router bind to L3 agent (router migration or create new),
  synchronization function sync_routers() try get MTU for all router
  interfaces by network IDs. This process run in function
  '_get_mtus_by_network_list' in l3_db.py file. But, when is formed
  database query, incorrect filters are passed in lines
  (https://github.com/openstack/neutron/blob/master/neutron/db/l3_db.py#L1719):

  ```
  filters = {'network_id': network_ids}
  fields = ['id', 'mtu']
  networks = self._core_plugin.get_networks(context, filters=filters, 
fields=fields)
  ```

  The mistake is that resource 'network' doesn't have field
  'network_id', he have field 'id'. As a result, runs for a few seconds
  on the big database. This slows down the router migration operation
  for a few seconds.

  To fix, you need to pass a filter by 'id' field.

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

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to