)]}'
{"nova/api/openstack/placement/handlers/allocation.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"52556ad793813499be2f7994141b5255c9dba67e","unresolved":false,"context_lines":[{"line_number":302,"context_line":"    else:"},{"line_number":303,"context_line":"        consumer_generation \u003d data.get(\u0027consumer_generation\u0027)"},{"line_number":304,"context_line":"        for resource_provider_uuid, allocation in allocation_data.items():"},{"line_number":305,"context_line":"            new_allocations \u003d _new_allocations(context,"},{"line_number":306,"context_line":"                                               resource_provider_uuid,"},{"line_number":307,"context_line":"                                               consumer_uuid,"},{"line_number":308,"context_line":"                                               allocation[\u0027resources\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_780d423c","line":305,"range":{"start_line":305,"start_character":12,"end_line":305,"end_character":55},"updated":"2018-06-26 09:28:53.000000000","message":"Sounds like we have race window at here.\n\nThe first request has allocations on two resource providers. After we bump the generation for the first resource provider, there is second request coming in with a generation which is same with the one we just bumped to. If the first request is unlucky on to get failed, the second request will success, but the generation get an unexpected increase.\n\nBut it sounds ok, we just a unexpected generation increase. The failed request just do a retry, then everything will be ok.\n\nTalk with Chris in the IRC, we have similar case if the allocation create failed, the generation will still get increased. https://bugs.launchpad.net/nova/+bug/1778591","commit_id":"aa95850bbfc7fd90c042311915cce3b7e34c6c28"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f6fecb382d7a23eaa03d60783336beaa8a8d9668","unresolved":false,"context_lines":[{"line_number":310,"context_line":"                                               data.get(\u0027user_id\u0027),"},{"line_number":311,"context_line":"                                               consumer_generation,"},{"line_number":312,"context_line":"                                               want_version)"},{"line_number":313,"context_line":"            consumer_generation \u003d new_allocations[0].consumer.generation"},{"line_number":314,"context_line":"            allocation_objects.extend(new_allocations)"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"    allocations \u003d rp_obj.AllocationList("}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_c1826cff","line":313,"range":{"start_line":313,"start_character":12,"end_line":313,"end_character":72},"updated":"2018-06-25 22:13:00.000000000","message":"So in this case could we wind up with an \"initial\" generation (as returned from the API) of \u003e0?","commit_id":"aa95850bbfc7fd90c042311915cce3b7e34c6c28"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"371a8e7fa0bce08c03e93929a5ec89791009f956","unresolved":false,"context_lines":[{"line_number":310,"context_line":"                                               data.get(\u0027user_id\u0027),"},{"line_number":311,"context_line":"                                               consumer_generation,"},{"line_number":312,"context_line":"                                               want_version)"},{"line_number":313,"context_line":"            consumer_generation \u003d new_allocations[0].consumer.generation"},{"line_number":314,"context_line":"            allocation_objects.extend(new_allocations)"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"    allocations \u003d rp_obj.AllocationList("}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_9d6e1094","line":313,"range":{"start_line":313,"start_character":12,"end_line":313,"end_character":72},"in_reply_to":"5f7c97a3_c1826cff","updated":"2018-06-26 08:15:27.000000000","message":"It can be two different things. If the consumer is brand spanking new it will be 0 (whereas data.get(\u0027consumer_generation\u0027) \u003d\u003d None). This is because the new object has a default of 0.\n\nIf the consumer already exists and the incoming generation is a number, it will be the same as what\u0027s in `data`. Since the incoming generation has to match the one in the object, and we\u0027re not looking at the loaded object.","commit_id":"aa95850bbfc7fd90c042311915cce3b7e34c6c28"}]}
