Comment 2 for bug 1843485

Revision history for this message
Flavio Fernandes (ffernand) wrote :

After some further digging, I can see that this is likely related to a
logic located in AddLRouterPortCommand :

https://github.com/openstack/networking-ovn/blob/5e2f1a5ad0b70d36e728e7a64d0652d6ae8facf4/networking_ovn/ovsdb/commands.py#L334

Since logical router port deleted has the same name as the logical router port being added,
the code is incorrectly assuming that the port already exists. And because of that the code
flow returns in line 334 instead of hitting the "idlutils.RowNotFound" exception.

This also causes the call to _add_gateway_chassis to be missed.

(Pdb) self.name
u'lrp-195beff8-09e9-42b4-abfd-0fc72a726cab'

So... DelLRouterPortCommand and AddLRouterPortCommand cannot use a port with same name!

The transaction object looks like this:

CheckRevisionNumberCommand(if_exists=True, resource={'status': u'ACTIVE', 'description': u'', 'tags': [], 'updated_at': '2019-09-10T20:48:55Z', 'revision_number': 3, \
'id': u'74ff4a1f-ff0a-4bd1-8e68-547dee654f5e', 'external_gateway_info': {'network_id': u'f7277974-cf8c-46ca-a00d-9da566e42ae9', 'enable_snat': True, 'external_fixed_i\
ps': [{'subnet_id': u'1637c183-a5e9-4e73-8b2c-b152c41ec6ae', 'ip_address': u'172.24.4.164'}]}, 'name': u'router2', 'gw_port_id': u'195beff8-09e9-42b4-abfd-0fc72a726ca\
b', 'admin_state_up': True, 'tenant_id': u'01f82375ae45484ead81d3af98613ca0', 'created_at': '2019-09-10T20:42:19Z', 'routes': [], 'project_id': u'01f82375ae45484ead81\
d3af98613ca0'}, name=neutron-74ff4a1f-ff0a-4bd1-8e68-547dee654f5e, resource_type=routers),

DeleteLRouterExtGwCommand(if_exists=True, lrouter=neutron-74ff4a1f-ff0a-4bd1-8e68-547dee654f5e),

DelLRouterPortCommand(if_exists=True, lrouter=neutron-74ff4a1f-ff0a-4bd1-8e68-547dee654f5e, name=lrp-195beff8-09e9-42b4-abfd-0fc72a726cab),

AddLRouterPortCommand(name=lrp-195beff8-09e9-42b4-abfd-0fc72a726cab, may_exist=True, lrouter=neutron-74ff4a1f-ff0a-4bd1-8e68-547dee654f5e, columns={'mac': 'fa:16:3e:9\
4:fc:a1', 'gateway_chassis': [u'84b16b41-103e-4d9f-a8f1-56159c1007dc'], 'external_ids': {'neutron:network_name': u'neutron-f7277974-cf8c-46ca-a00d-9da566e42ae9', 'neu\
tron:subnet_ids': u'1637c183-a5e9-4e73-8b2c-b152c41ec6ae', 'neutron:revision_number': '6', 'neutron:router_name': u'74ff4a1f-ff0a-4bd1-8e68-547dee654f5e'}, 'networks'\
: ['172.24.4.164/24']}),

SetLRouterPortInLSwitchPortCommand(if_exists=True, lswitch_port=195beff8-09e9-42b4-abfd-0fc72a726cab, lrouter_port=lrp-195beff8-09e9-42b4-abfd-0fc72a726cab, is_gw_por\
t=True, lsp_address=router),

AddStaticRouteCommand(lrouter=neutron-74ff4a1f-ff0a-4bd1-8e68-547dee654f5e, columns={'ip_prefix': '0.0.0.0/0', 'external_ids': {'neutron:subnet_id': u'1637c183-a5e9-4\
e73-8b2c-b152c41ec6ae', 'neutron:is_ext_gw': 'true'}, 'nexthop': '172.24.4.1'}),

UpdateLRouterCommand(if_exists=True, columns={'external_ids': {'neutron:gw_port_id': u'195beff8-09e9-42b4-abfd-0fc72a726cab', 'neutron:router_name': u'router2', 'neut\
ron:revision_number': '3'}, 'enabled': True}, name=neutron-74ff4a1f-ff0a-4bd1-8e68-547dee654f5e)