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@IBMCN   Internet: jiche...@cn.ibm.com
Phone: +86-10-82454158
Address: 3/F Ring Building, ZhongGuanCun Software Park, Haidian District,
Beijing 100193, PRC
_______________________________________________
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to