[openstack-dev] [Nova] Question about concurrent access of multiple API server

Chen CH Ji jichenjc at cn.ibm.com
Fri Feb 28 06:53:34 UTC 2014


According to this bug https://bugs.launchpad.net/nova/+bug/1268569

I am wondering someone can help me in understanding the concurrent access
prevention on api layer?

if we have more than 1 nova-api server, let's say 2(thread A and thread
B) ,so both of them should be able to handle request from user
let's say we delete same floating ip 2 times at almost same time,
if thread A and B both pass the test in following logic (that's possible
because they run concurrently)

api/openstack/compute/contrib/floating_ips.py
def delete(self, req, id):
..........
try:
            floating_ip = self.network_api.get_floating_ip(context, id)
        except (exception.NotFound, exception.InvalidID):
            msg = _("Floating ip not found for id %s") % id
            raise webob.exc.HTTPNotFound(explanation=msg)
..........

then both of them will call following function
self.network_api.release_floating_ip(context, address)

at last function deallocate_floating_ip in nova/network/float_ips.py will
be called by both A and B ,this will not lead to logic error
because db layer will not return error if it can't find the floating_ip
but quota will be reserve and commit 2 times, that lead to wrong quota
error

Could someone help to clarify my understanding or any help on what kind of
concurrent access prevention we have ?


Best Regards!

Kevin (Chen) Ji 纪 晨

Engineer, zVM Development, CSTL
Notes: Chen CH Ji/China/IBM at IBMCN   Internet: jichenjc at cn.ibm.com
Phone: +86-10-82454158
Address: 3/F Ring Building, ZhongGuanCun Software Park, Haidian District,
Beijing 100193, PRC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140228/28ecc93c/attachment.html>


More information about the OpenStack-dev mailing list