[RFE] introduce distributed locks to ipam

Bug #1836834 reported by qinhaizhong
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Confirmed
Wishlist
qinhaizhong

Bug Description

When the virtual machines are created in batches, nova will call the neutron API to create the port concurrently. When an ip allocation conflict fails to submit a database, a ``DB ERROR`` exception is thrown. ``Create_port`` will catch the above exception and rest after ``retry_interval=0.1`` and re-call ``create_port`` until it exceeds ``max_retries=10``.When it exceeds ``max_retries=10`` times, "Create_port" will fail. And bulk create port has similar problem.

The current design using the retry mechanism will cause the neutron burden to burst rapidly. At this time, the api that calls neutron will not be able to get the corresponding in 60 seconds. The caller will judge that the neutron api fails to be called, which will cause various problems.

Details see https://bugs.launchpad.net/neutron/+bug/1777968. And bulk port creation has the same problem.

We will implements a new ipam driver by introducing a distributed lock to completely solve the problem of ip address allocation conflict leading to failure. And distributed locks we will use openstack tooz, which supports many backend
drivers, such as Zookeeper, Memcached, Redis, Mysql, etc. And tooz is an openstack native project.

Tags: rfe-approved
Changed in neutron:
assignee: nobody → qinhaizhong (qinhaizhong)
Changed in neutron:
status: New → In Progress
description: updated
Changed in neutron:
status: In Progress → New
description: updated
description: updated
description: updated
Brin Zhang (zhangbailin)
tags: added: rfe-confirmed
removed: rfe
tags: added: rfe
Hongbin Lu (hongbin.lu)
Changed in neutron:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Miguel Lavalle (minsel) wrote :

Can you give a little more detail as to how you propose to implement this? We need to approve this in the Drivers team, so we would like more detail.

Also, you state that "And it is an openstack native project.". Does this mean you are going to create a new project to solve this problem?

Revision history for this message
qinhaizhong (qinhaizhong) wrote :

@minsel,
Our core logic is as follows:
Based on the original _generate_ips algorithm, this method will be reimplemented. The ips calculated for _generate_ips will be "ip+subnet_id" as the key plus the distributed lock. If the lock failure means conflict, we will re-generate_ips when allocated. After the ip is submitted to the database, it is unlocked, which guarantees concurrent performance and completely resolves conflicts.

"And it is an openstack native project.",I mean that tooz is an openstack native project, I have updated the description. Thank you.

description: updated
Revision history for this message
LIU Yulong (dragon889) wrote :
Miguel Lavalle (minsel)
tags: added: rfe-triaged
removed: rfe rfe-confirmed
Miguel Lavalle (minsel)
tags: added: rfe-approved
removed: rfe-triaged
Revision history for this message
Miguel Lavalle (minsel) wrote :

This RFE was approved on July 26th during the drivers meeting on the following assumptions:

1) A more detailed spec will be proposed
2) We will see the code as a PoC. We will use the experience of the PoC to feedback on the spec if needed
3) The code will come with Rally tests, so we can measure improvement

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.