One port can be added as multiple routers' interfaces if commands are executed at the same time
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Low
|
Lujin Luo |
Bug Description
I have three controller nodes and the Neutron servers on these controllers are set behind Pacemaker and HAProxy to realize active/active HA using DevStack. MariaDB Galera cluster is used as my database backend.I am using the latest codes.
If one port is added as multiple routers' interfaces, the expected result is that only API request is executed successfully and the port is associated to one router. Other API requests would recieve error message like
PortInUseClient: Unable to complete operation on port d2c97788-
Besides, in routerports database, only one record of port is allowed to exist. However, if we run two commands to add one port as two different routers' interfaces at the same time. Both of the commands would show execution succeed. The truth is two records that the port is associated to both routers are listed in routerports database.
How to reproduce
Step 1: Create two routers
$ neutron router-create router-1
$ neutron router-create router-2
Step 2: Create an internal network
$ neutron net-create net1
Step 3: Add a subnet to the network
$ neutron subnet-create --name subnet1 net1 192.166.100.0/24
Step 4: Create a port in the network
$ neutron port-create --name port1 net1
Step 5: Add this port as two routers' interfaces at the same time
On controller1:
$ neutron router-
on controller2:
$ neutron router-
Both commands would return success, as shown http://
Step 6: Check port list on both routers
The result is shown http://
As we can see, only one router is successfully associated to the port
Step 7: Check routerports database
http://
where '99276755-
To sum up, we have two issues here
a) Only one API request is executed successfully, but both commands return success
b) Routerports database is updated twice and we need to delete the older record.
Related source codes is [1]
[1] https:/
-------
If we have operator-1 who is trying to add port_1 as router_1's interface while at the same time operator-2 is trying to add port_2 as router_2's interface. However, operator-2 miss-typed "port-2" to "port-1". Without this unique key, both commands will return Success. Operator-2 would hardly realize that he/she did a wrong command. What is worse is that, if router_1 truly added port_1 as interface, and router_2 did not. If we perform interface_delete command on router_2, port_1 is deleted and router_1 (which truly has the interface of port_1) will lose interface.
Changed in neutron: | |
assignee: | nobody → Lujin Luo (luo-lujin) |
tags: | added: l3-ipam-dhcp |
Changed in neutron: | |
importance: | Undecided → Low |
description: | updated |
Fix proposed to branch: master /review. openstack. org/285048
Review: https:/