Comment 12 for bug 1811222

Revision history for this message
Blake Rouse (blake-rouse) wrote :

The code path is that 2 controller processes that could be a regiond process or a rackd process can start a registration at the same time. The validation check was done inside the code and not at the database level for the physical interface 1 mac address.

So when 2 threads run and both create the same physical interface with the same mac address at the same time the database was not enforcing the data consistency as it should have, well because it didn't know about it. If you look at the MP you can see that this case is specifically tested, and if you remove the unique index that test would fail.

Now in the case that 2 threads are running at the same time one of them will get a IntegrityError and the whole process will be retried and on the retry the registration process will notice that a physical interface already exists and do the correct thing. The code path already handles the case where a physical all ready exists for the same controller (that is the case here on the same controller).