)]}'
{"specs/rocky/approved/add-consumer-generation.rst":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9911c4db62f559c8b5ed292bec487da24abc2db9","unresolved":false,"context_lines":[{"line_number":83,"context_line":"following behavior:"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"* Microversion \u003c1.8: always succeeds and always overwrites the consumer\u0027s"},{"line_number":86,"context_line":"  allocations entirely, with no protection. There will continue to not be any"},{"line_number":87,"context_line":"  consumer record since ``project_id`` and ``user_id`` will be missing from the"},{"line_number":88,"context_line":"  request"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, the existing consumer record will"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_ee16f049","line":87,"range":{"start_line":86,"start_character":44,"end_line":87,"end_character":17},"updated":"2018-05-01 20:04:40.000000000","message":"Do you mean that the existing consumer record (cause there is one, see L82) will be *deleted*?\n\nThis is the case that worries me.  It means that the allocation was originally created by a \u003e\u003d1.8 API call.  I know we can\u0027t fail (behavior change) but I wonder if we should preserve the consumer record and increment its generation (without protection).\n\nThe inverse (L71) also makes me uncomfortable: we\u0027re not registering a generation for pre-1.8 calls, but subsequent post-1.8 calls (and worse, 1.X calls) will do so.  Then when this (pre-1.8) guy comes back to do something with that record... what happens?\n\nThis was the part that led to all the complexity and debate in Ed\u0027s patch series.\n\nI think I just need to get over it. Users with multiple threads mucking with the same consumer should *all* be using the latest microversion, or they deserve what they get.\n\nNevertheless, this sentence needs to be fixed to state that we either delete, ignore, or unprotectedly increment the existing record.","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"745a57532c3afa3a6c523e273fcc51c91094fcbf","unresolved":false,"context_lines":[{"line_number":83,"context_line":"following behavior:"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"* Microversion \u003c1.8: always succeeds and always overwrites the consumer\u0027s"},{"line_number":86,"context_line":"  allocations entirely, with no protection. There will continue to not be any"},{"line_number":87,"context_line":"  consumer record since ``project_id`` and ``user_id`` will be missing from the"},{"line_number":88,"context_line":"  request"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, the existing consumer record will"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_c958c657","line":87,"range":{"start_line":86,"start_character":44,"end_line":87,"end_character":17},"in_reply_to":"9f6a8fd7_498276ca","updated":"2018-05-01 22:14:08.000000000","message":"OK, I\u0027ve reworded this and added a big old warning about the lack of safety in using different microversions on the allocations endpoints.","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ba3d5ce3435a501a8284310e8e5fe7e4aa66ae71","unresolved":false,"context_lines":[{"line_number":83,"context_line":"following behavior:"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"* Microversion \u003c1.8: always succeeds and always overwrites the consumer\u0027s"},{"line_number":86,"context_line":"  allocations entirely, with no protection. There will continue to not be any"},{"line_number":87,"context_line":"  consumer record since ``project_id`` and ``user_id`` will be missing from the"},{"line_number":88,"context_line":"  request"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, the existing consumer record will"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_498276ca","line":87,"range":{"start_line":86,"start_character":44,"end_line":87,"end_character":17},"in_reply_to":"9f6a8fd7_8983ae56","updated":"2018-05-01 21:14:43.000000000","message":"\u003e Now consider the case \u003e\u003d1.X: the caller is expecting that if they\n \u003e PUT /allocations with None for consumer_generation, it will not\n \u003e overwrite, only create. If we don\u0027t create the record for \u003c1.8,\n \u003e there is no way to prevent this from happening.\n\nTrue, though the end result for the user is that the allocations will be overwritten and there will be a new consumers record created with a brand new generation and associated project/user. So, to the \u003e\u003d1.X caller, the end result is exactly what they expected would occur. And for the \u003c1.8 caller, there was no guarantee that their allocations wouldn\u0027t be modified by another caller to begin with.\n\nI\u0027m just not that concerned about it, though.","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"5dae9a4d2c807179f8c50e8f4b3e1707c3a84dd5","unresolved":false,"context_lines":[{"line_number":83,"context_line":"following behavior:"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"* Microversion \u003c1.8: always succeeds and always overwrites the consumer\u0027s"},{"line_number":86,"context_line":"  allocations entirely, with no protection. There will continue to not be any"},{"line_number":87,"context_line":"  consumer record since ``project_id`` and ``user_id`` will be missing from the"},{"line_number":88,"context_line":"  request"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, the existing consumer record will"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_8983ae56","line":87,"range":{"start_line":86,"start_character":44,"end_line":87,"end_character":17},"in_reply_to":"9f6a8fd7_aef2386e","updated":"2018-05-01 20:54:39.000000000","message":"Microversions only change when the API call or response changes. There is nothing to say that we can\u0027t modify/improve the internals of the application, which is what creating a record is. The API call \u003c1.8 remains the same, and the behavior to the caller is the same. So adding the record doesn\u0027t have anything to do with the API.\n\nNow consider the case \u003e\u003d1.X: the caller is expecting that if they PUT /allocations with None for consumer_generation, it will not overwrite, only create. If we don\u0027t create the record for \u003c1.8, there is no way to prevent this from happening.","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9d529eb7bc32f5d1800c7988afd2813ce61b121b","unresolved":false,"context_lines":[{"line_number":83,"context_line":"following behavior:"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"* Microversion \u003c1.8: always succeeds and always overwrites the consumer\u0027s"},{"line_number":86,"context_line":"  allocations entirely, with no protection. There will continue to not be any"},{"line_number":87,"context_line":"  consumer record since ``project_id`` and ``user_id`` will be missing from the"},{"line_number":88,"context_line":"  request"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, the existing consumer record will"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_aef2386e","line":87,"range":{"start_line":86,"start_character":44,"end_line":87,"end_character":17},"in_reply_to":"9f6a8fd7_cebe8cfe","updated":"2018-05-01 20:37:58.000000000","message":"@edleafe: See my explanation above. For PUT /allocations/{uuid} before 1.8, no consumer record is created, and that is to be expected.","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9d529eb7bc32f5d1800c7988afd2813ce61b121b","unresolved":false,"context_lines":[{"line_number":83,"context_line":"following behavior:"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"* Microversion \u003c1.8: always succeeds and always overwrites the consumer\u0027s"},{"line_number":86,"context_line":"  allocations entirely, with no protection. There will continue to not be any"},{"line_number":87,"context_line":"  consumer record since ``project_id`` and ``user_id`` will be missing from the"},{"line_number":88,"context_line":"  request"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, the existing consumer record will"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_2e50685e","line":87,"range":{"start_line":86,"start_character":44,"end_line":87,"end_character":17},"in_reply_to":"9f6a8fd7_ee16f049","updated":"2018-05-01 20:37:58.000000000","message":"\u003e Do you mean that the existing consumer record (cause there is one,\n \u003e see L82) will be *deleted*?\n\nI should clarify line 82 and line 68 to say \"when there have (or have not) been allocations created for a consumer with this UUID already\". The \"consumer record\" is actually a red herring, since allocations could have been created for the consumer prior to 1.8 and there would be no consumers table record but there *would* be one or more allocations table records that exist for that consumer UUID.\n\n \u003e This is the case that worries me.  It means that the allocation was\n \u003e originally created by a \u003e\u003d1.8 API call.  I know we can\u0027t fail\n \u003e (behavior change) but I wonder if we should preserve the consumer\n \u003e record and increment its generation (without protection).\n\nNo, there is no consumer record to preserve.\n\n \u003e The inverse (L71) also makes me uncomfortable: we\u0027re not\n \u003e registering a generation for pre-1.8 calls, but subsequent post-1.8\n \u003e calls (and worse, 1.X calls) will do so.  Then when this (pre-1.8)\n \u003e guy comes back to do something with that record... what happens?\n\nYou mean if a 1.8+ call creates the allocations (and ends up creating the consumers table record) and then another client attempts to call \u003c1.8 to change those allocations?\n\nThe changes will go through with no safety (and no update of the consumers table generation). This is, unfortunately, the only thing we can do.\n\nHowever, trying to do something different is not something I think is worth spending time on.\n\n \u003e This was the part that led to all the complexity and debate in Ed\u0027s\n \u003e patch series.\n\nIt\u0027s not complicated in my patches. It is handled here:\n\nhttps://review.openstack.org/#/c/565405/4/nova/api/openstack/placement/handlers/allocation.py\n\nlines 269-270. There will be a None Allocation.consumer object supplied because no project_id will be in the request. When there is a None Allocation.consumer object, the consumer is not included in the generation increment on line 2088 here:\n\nhttps://review.openstack.org/#/c/565513/4/nova/api/openstack/placement/objects/resource_provider.py\n\n \u003e I think I just need to get over it. Users with multiple threads\n \u003e mucking with the same consumer should *all* be using the latest\n \u003e microversion, or they deserve what they get.\n \u003e \n \u003e Nevertheless, this sentence needs to be fixed to state that we\n \u003e either delete, ignore, or unprotectedly increment the existing\n \u003e record.","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8ee4e50fc720d411750236d77ac648c6fd7c9476","unresolved":false,"context_lines":[{"line_number":83,"context_line":"following behavior:"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"* Microversion \u003c1.8: always succeeds and always overwrites the consumer\u0027s"},{"line_number":86,"context_line":"  allocations entirely, with no protection. There will continue to not be any"},{"line_number":87,"context_line":"  consumer record since ``project_id`` and ``user_id`` will be missing from the"},{"line_number":88,"context_line":"  request"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, the existing consumer record will"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_cebe8cfe","line":87,"range":{"start_line":86,"start_character":44,"end_line":87,"end_character":17},"in_reply_to":"9f6a8fd7_ee16f049","updated":"2018-05-01 20:13:26.000000000","message":"I don\u0027t think you need to get over it. It is important.\n\nThe consumer record should always be created. For \u003c1.8, where there is no project/user, it should be created with generation 0 and {EMPTY} for the project_id/user_id. Originally, {EMPTY} was going to be null, but since we now want to avoid that, we should put a value that means \"we have no idea\". For integer fields like this, -1 would be a fair choice.","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8ee4e50fc720d411750236d77ac648c6fd7c9476","unresolved":false,"context_lines":[{"line_number":98,"context_line":"  mismatch. Furthermore, if another process modifies the same consumer\u0027s"},{"line_number":99,"context_line":"  allocations concurrently to the request, the generation increment will fail"},{"line_number":100,"context_line":"  for the consumer and a ``409 Conflict`` will be returned indicating a"},{"line_number":101,"context_line":"  concurrent write occurred and the caller should re-read the consumer\u0027s"},{"line_number":102,"context_line":"  generation and retry its request as appropriate."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"``POST /allocations``"},{"line_number":105,"context_line":"---------------------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_ee67d0b6","line":102,"range":{"start_line":101,"start_character":32,"end_line":102,"end_character":50},"updated":"2018-05-01 20:13:26.000000000","message":"Well, not just its generation, but the allocations for that consumer, and adjust its request as needed. This whole effort means nothing if they retry is just grabbing the latest generation and re-trying the same request with the new value.","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"745a57532c3afa3a6c523e273fcc51c91094fcbf","unresolved":false,"context_lines":[{"line_number":98,"context_line":"  mismatch. Furthermore, if another process modifies the same consumer\u0027s"},{"line_number":99,"context_line":"  allocations concurrently to the request, the generation increment will fail"},{"line_number":100,"context_line":"  for the consumer and a ``409 Conflict`` will be returned indicating a"},{"line_number":101,"context_line":"  concurrent write occurred and the caller should re-read the consumer\u0027s"},{"line_number":102,"context_line":"  generation and retry its request as appropriate."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"``POST /allocations``"},{"line_number":105,"context_line":"---------------------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_89616e3c","line":102,"range":{"start_line":101,"start_character":32,"end_line":102,"end_character":50},"in_reply_to":"9f6a8fd7_ee67d0b6","updated":"2018-05-01 22:14:08.000000000","message":"Done","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"352ec26ab171275330aefa7d88894745009eacad","unresolved":false,"context_lines":[{"line_number":98,"context_line":"  mismatch. Furthermore, if another process modifies the same consumer\u0027s"},{"line_number":99,"context_line":"  allocations concurrently to the request, the generation increment will fail"},{"line_number":100,"context_line":"  for the consumer and a ``409 Conflict`` will be returned indicating a"},{"line_number":101,"context_line":"  concurrent write occurred and the caller should re-read the consumer\u0027s"},{"line_number":102,"context_line":"  generation and retry its request as appropriate."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"``POST /allocations``"},{"line_number":105,"context_line":"---------------------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_8975ee9a","line":102,"range":{"start_line":101,"start_character":32,"end_line":102,"end_character":50},"in_reply_to":"9f6a8fd7_ee67d0b6","updated":"2018-05-01 20:48:18.000000000","message":"I can add more text here. \"as appropriate\" was meant to convey \"as the caller requires\".","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9911c4db62f559c8b5ed292bec487da24abc2db9","unresolved":false,"context_lines":[{"line_number":138,"context_line":"  generation increment will fail for the consumer and a ``409 Conflict`` will"},{"line_number":139,"context_line":"  be returned indicating a concurrent write occurred and the caller should"},{"line_number":140,"context_line":"  re-read the consumer\u0027s generation and retry its request as appropriate."},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"Alternatives"},{"line_number":143,"context_line":"------------"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_53b78587","line":141,"updated":"2018-05-01 20:04:40.000000000","message":"We need to mention that we\u0027re not mucking with DELETE, because there\u0027s no good way to specify a generation there.  (In Alternatives we can state that we considered adding the generation to a header, queryparam, and payload on DELETE but couldn\u0027t conscion the inconsistency.)  So generation-safe deletions need to be done via PUT/POST with an empty allocations dict.","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"745a57532c3afa3a6c523e273fcc51c91094fcbf","unresolved":false,"context_lines":[{"line_number":138,"context_line":"  generation increment will fail for the consumer and a ``409 Conflict`` will"},{"line_number":139,"context_line":"  be returned indicating a concurrent write occurred and the caller should"},{"line_number":140,"context_line":"  re-read the consumer\u0027s generation and retry its request as appropriate."},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"Alternatives"},{"line_number":143,"context_line":"------------"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_a478198f","line":141,"in_reply_to":"9f6a8fd7_53b78587","updated":"2018-05-01 22:14:08.000000000","message":"Done","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"2a83a071fda56533b68f3ca40b9eb6ed57eb3b96","unresolved":false,"context_lines":[{"line_number":138,"context_line":"  generation increment will fail for the consumer and a ``409 Conflict`` will"},{"line_number":139,"context_line":"  be returned indicating a concurrent write occurred and the caller should"},{"line_number":140,"context_line":"  re-read the consumer\u0027s generation and retry its request as appropriate."},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"Alternatives"},{"line_number":143,"context_line":"------------"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_6ebae06e","line":141,"in_reply_to":"9f6a8fd7_53b78587","updated":"2018-05-01 20:41:38.000000000","message":"OK, no prob, I can add that.","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9911c4db62f559c8b5ed292bec487da24abc2db9","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        \u0027consumer_generation\u0027: CONSUMER_GENERATION"},{"line_number":208,"context_line":"    }"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"  The PUT method will be changed to require consumer generation, and will"},{"line_number":211,"context_line":"  return a 409 Conflict if the supplied generation does not match the current"},{"line_number":212,"context_line":"  value in the consumers table. See above for detailed explanation of the"},{"line_number":213,"context_line":"  expected behavior."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_733de9db","line":210,"range":{"start_line":210,"start_character":6,"end_line":210,"end_character":9},"updated":"2018-05-01 20:04:40.000000000","message":"PUT will also be modified to allow an empty allocations dict.  This (or POST with an empty allocations dict) is how you have to delete if you want generation protection.","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"5dae9a4d2c807179f8c50e8f4b3e1707c3a84dd5","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        \u0027consumer_generation\u0027: CONSUMER_GENERATION"},{"line_number":208,"context_line":"    }"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"  The PUT method will be changed to require consumer generation, and will"},{"line_number":211,"context_line":"  return a 409 Conflict if the supplied generation does not match the current"},{"line_number":212,"context_line":"  value in the consumers table. See above for detailed explanation of the"},{"line_number":213,"context_line":"  expected behavior."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_895f2ee4","line":210,"range":{"start_line":210,"start_character":6,"end_line":210,"end_character":9},"in_reply_to":"9f6a8fd7_6e48a086","updated":"2018-05-01 20:54:39.000000000","message":"That was the consensus reached among all of us. While it is technically possible to use POST, PUT just makes more sense","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"2a83a071fda56533b68f3ca40b9eb6ed57eb3b96","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        \u0027consumer_generation\u0027: CONSUMER_GENERATION"},{"line_number":208,"context_line":"    }"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"  The PUT method will be changed to require consumer generation, and will"},{"line_number":211,"context_line":"  return a 409 Conflict if the supplied generation does not match the current"},{"line_number":212,"context_line":"  value in the consumers table. See above for detailed explanation of the"},{"line_number":213,"context_line":"  expected behavior."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_6e48a086","line":210,"range":{"start_line":210,"start_character":6,"end_line":210,"end_character":9},"in_reply_to":"9f6a8fd7_733de9db","updated":"2018-05-01 20:41:38.000000000","message":"Hmm, is that what Chris recommended? If you want to delete all allocations for a consumer and have protection, why not use POST /allocations since that is already set up for the whole \"empty allocations\" thing?","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f1301c271c50cefeff659b586826d77abc1e15c6","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        \u0027consumer_generation\u0027: CONSUMER_GENERATION"},{"line_number":208,"context_line":"    }"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"  The PUT method will be changed to require consumer generation, and will"},{"line_number":211,"context_line":"  return a 409 Conflict if the supplied generation does not match the current"},{"line_number":212,"context_line":"  value in the consumers table. See above for detailed explanation of the"},{"line_number":213,"context_line":"  expected behavior."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_69b41ad2","line":210,"range":{"start_line":210,"start_character":6,"end_line":210,"end_character":9},"in_reply_to":"9f6a8fd7_895f2ee4","updated":"2018-05-01 21:06:50.000000000","message":"Agreed.","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9911c4db62f559c8b5ed292bec487da24abc2db9","unresolved":false,"context_lines":[{"line_number":240,"context_line":"        # This will be a new required field in the POST request"},{"line_number":241,"context_line":"        \"consumer_generation\""},{"line_number":242,"context_line":"    ]"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"Security impact"},{"line_number":245,"context_line":"---------------"},{"line_number":246,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_9330bd09","line":243,"updated":"2018-05-01 20:04:40.000000000","message":"POST will be changed to require consumer generation per consumer section, yattayatta.","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"2a83a071fda56533b68f3ca40b9eb6ed57eb3b96","unresolved":false,"context_lines":[{"line_number":240,"context_line":"        # This will be a new required field in the POST request"},{"line_number":241,"context_line":"        \"consumer_generation\""},{"line_number":242,"context_line":"    ]"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"Security impact"},{"line_number":245,"context_line":"---------------"},{"line_number":246,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_ce58cc57","line":243,"in_reply_to":"9f6a8fd7_9330bd09","updated":"2018-05-01 20:41:38.000000000","message":"ack.","commit_id":"fd119a850f66eaad8edcf64a513a062c471aa286"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"94b222a3e58747ac60a1949b1a8e68fd3bbd9678","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    allocations, and a subsequent call to GET /allocations/{uuid} with"},{"line_number":139,"context_line":"    microversion 1.X would return different allocations but the same"},{"line_number":140,"context_line":"    generation. This is why calling the allocations endpoints with different"},{"line_number":141,"context_line":"    microversions is not safe and should not be done."},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, the existing consumer record will"},{"line_number":144,"context_line":"  have its generation automatically incremented with no protection against"}],"source_content_type":"text/x-rst","patch_set":2,"id":"9f6a8fd7_3f565008","line":141,"updated":"2018-05-01 22:42:37.000000000","message":"yup, ++","commit_id":"7d1035317f250b455e2d6419df92107e9dc6d4bb"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"94b222a3e58747ac60a1949b1a8e68fd3bbd9678","unresolved":false,"context_lines":[{"line_number":296,"context_line":"        \u0027consumer_generation\u0027: CONSUMER_GENERATION"},{"line_number":297,"context_line":"    }"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"  The PUT method will be changed to require consumer generation, and will"},{"line_number":300,"context_line":"  return a 409 Conflict if the supplied generation does not match the current"},{"line_number":301,"context_line":"  value in the consumers table. See above for detailed explanation of the"},{"line_number":302,"context_line":"  expected behavior."}],"source_content_type":"text/x-rst","patch_set":2,"id":"9f6a8fd7_5f59c432","line":299,"range":{"start_line":299,"start_character":6,"end_line":299,"end_character":9},"updated":"2018-05-01 22:42:37.000000000","message":"We still also need to change PUT to accept an empty allocations dict.","commit_id":"7d1035317f250b455e2d6419df92107e9dc6d4bb"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"d13b75cc49eb22b15057991c330a318c5d3001e4","unresolved":false,"context_lines":[{"line_number":296,"context_line":"        \u0027consumer_generation\u0027: CONSUMER_GENERATION"},{"line_number":297,"context_line":"    }"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"  The PUT method will be changed to require consumer generation, and will"},{"line_number":300,"context_line":"  return a 409 Conflict if the supplied generation does not match the current"},{"line_number":301,"context_line":"  value in the consumers table. See above for detailed explanation of the"},{"line_number":302,"context_line":"  expected behavior."}],"source_content_type":"text/x-rst","patch_set":2,"id":"9f6a8fd7_e9e6d8e8","line":299,"range":{"start_line":299,"start_character":6,"end_line":299,"end_character":9},"in_reply_to":"9f6a8fd7_5f59c432","updated":"2018-05-02 15:53:46.000000000","message":"Done","commit_id":"7d1035317f250b455e2d6419df92107e9dc6d4bb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d615746cc8d85c7027106fe57123eae3a649fef0","unresolved":false,"context_lines":[{"line_number":25,"context_line":"allocations for that consumer. There is a potential race condition when more"},{"line_number":26,"context_line":"than one process is making allocations for a consumer. For example, Nova is"},{"line_number":27,"context_line":"creating an instance, and asking Neutron to create the required network"},{"line_number":28,"context_line":"resources. Neutron does so, and creates the allocations. Nova then claims the"},{"line_number":29,"context_line":"resources it\u0027s providing for the instance, and writes its understanding of the"},{"line_number":30,"context_line":"current allocations to Placement, overwriting Neutron\u0027s allocations."},{"line_number":31,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_c52c6f4c","line":28,"range":{"start_line":28,"start_character":11,"end_line":28,"end_character":54},"updated":"2018-05-17 19:41:07.000000000","message":"Against the instance, because that\u0027s what we agreed to use for the bandwidth-aware scheduling spec, right.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"331ad85e7caed9781747a1a9c5a533d2d82c69a8","unresolved":false,"context_lines":[{"line_number":25,"context_line":"allocations for that consumer. There is a potential race condition when more"},{"line_number":26,"context_line":"than one process is making allocations for a consumer. For example, Nova is"},{"line_number":27,"context_line":"creating an instance, and asking Neutron to create the required network"},{"line_number":28,"context_line":"resources. Neutron does so, and creates the allocations. Nova then claims the"},{"line_number":29,"context_line":"resources it\u0027s providing for the instance, and writes its understanding of the"},{"line_number":30,"context_line":"current allocations to Placement, overwriting Neutron\u0027s allocations."},{"line_number":31,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_36cf9b58","line":28,"range":{"start_line":28,"start_character":11,"end_line":28,"end_character":54},"in_reply_to":"5f7c97a3_965d4feb","updated":"2018-05-17 21:34:14.000000000","message":"True, but not really relevant here, because neutron still isn\u0027t the thing doing the allocating per that spec - only in this hypothetical.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"812fdb1c3632a95950236329b24e14d573299b1d","unresolved":false,"context_lines":[{"line_number":25,"context_line":"allocations for that consumer. There is a potential race condition when more"},{"line_number":26,"context_line":"than one process is making allocations for a consumer. For example, Nova is"},{"line_number":27,"context_line":"creating an instance, and asking Neutron to create the required network"},{"line_number":28,"context_line":"resources. Neutron does so, and creates the allocations. Nova then claims the"},{"line_number":29,"context_line":"resources it\u0027s providing for the instance, and writes its understanding of the"},{"line_number":30,"context_line":"current allocations to Placement, overwriting Neutron\u0027s allocations."},{"line_number":31,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_e01dd973","line":28,"range":{"start_line":28,"start_character":11,"end_line":28,"end_character":54},"in_reply_to":"5f7c97a3_c52c6f4c","updated":"2018-05-17 21:19:48.000000000","message":"No, IIUC that spec still has nova doing the allocation for the network resources.\n\n...for now.\n\nI think this problem description is currently hypothetical.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7db0419883ab032ca5c43a6a03100acc3e58c43a","unresolved":false,"context_lines":[{"line_number":25,"context_line":"allocations for that consumer. There is a potential race condition when more"},{"line_number":26,"context_line":"than one process is making allocations for a consumer. For example, Nova is"},{"line_number":27,"context_line":"creating an instance, and asking Neutron to create the required network"},{"line_number":28,"context_line":"resources. Neutron does so, and creates the allocations. Nova then claims the"},{"line_number":29,"context_line":"resources it\u0027s providing for the instance, and writes its understanding of the"},{"line_number":30,"context_line":"current allocations to Placement, overwriting Neutron\u0027s allocations."},{"line_number":31,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_965d4feb","line":28,"range":{"start_line":28,"start_character":11,"end_line":28,"end_character":54},"in_reply_to":"5f7c97a3_e01dd973","updated":"2018-05-17 21:23:54.000000000","message":"I meant at one point we discussed the neutron resources being allocated against ports rather than instances but agreed that the instance would own all of it.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d615746cc8d85c7027106fe57123eae3a649fef0","unresolved":false,"context_lines":[{"line_number":46,"context_line":"all Placement responses that provide data for a consumer, and must be included"},{"line_number":47,"context_line":"in any request to placement that changes allocations for that consumer. As is"},{"line_number":48,"context_line":"the case for updates to ResourceProviders, if the supplied consumer generation"},{"line_number":49,"context_line":"doesn\u0027t match the the current value, Placement will reject the request and"},{"line_number":50,"context_line":"return a 409 Conflict response. Since in many cases there will not be an"},{"line_number":51,"context_line":"existing consumer record, the request would supply ``None`` as the consumer"},{"line_number":52,"context_line":"generation."}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_651d5b0e","line":49,"range":{"start_line":49,"start_character":14,"end_line":49,"end_character":21},"updated":"2018-05-17 19:41:07.000000000","message":"the","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"812fdb1c3632a95950236329b24e14d573299b1d","unresolved":false,"context_lines":[{"line_number":46,"context_line":"all Placement responses that provide data for a consumer, and must be included"},{"line_number":47,"context_line":"in any request to placement that changes allocations for that consumer. As is"},{"line_number":48,"context_line":"the case for updates to ResourceProviders, if the supplied consumer generation"},{"line_number":49,"context_line":"doesn\u0027t match the the current value, Placement will reject the request and"},{"line_number":50,"context_line":"return a 409 Conflict response. Since in many cases there will not be an"},{"line_number":51,"context_line":"existing consumer record, the request would supply ``None`` as the consumer"},{"line_number":52,"context_line":"generation."}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_a017e151","line":49,"range":{"start_line":49,"start_character":14,"end_line":49,"end_character":21},"in_reply_to":"5f7c97a3_651d5b0e","updated":"2018-05-17 21:19:48.000000000","message":"Done","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d615746cc8d85c7027106fe57123eae3a649fef0","unresolved":false,"context_lines":[{"line_number":51,"context_line":"existing consumer record, the request would supply ``None`` as the consumer"},{"line_number":52,"context_line":"generation."},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"As this is an API change, a new microversion will be created. Any older service"},{"line_number":55,"context_line":"that does not support this new microversion will continue to work, but will be"},{"line_number":56,"context_line":"susceptible to the race condition described above."},{"line_number":57,"context_line":""},{"line_number":58,"context_line":".. note::"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_45e5bf09","line":55,"range":{"start_line":54,"start_character":62,"end_line":55,"end_character":65},"updated":"2018-05-17 19:41:07.000000000","message":"Presumably because the new generation field in the request is optional (since we don\u0027t have a generation for new allocations?).","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"812fdb1c3632a95950236329b24e14d573299b1d","unresolved":false,"context_lines":[{"line_number":51,"context_line":"existing consumer record, the request would supply ``None`` as the consumer"},{"line_number":52,"context_line":"generation."},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"As this is an API change, a new microversion will be created. Any older service"},{"line_number":55,"context_line":"that does not support this new microversion will continue to work, but will be"},{"line_number":56,"context_line":"susceptible to the race condition described above."},{"line_number":57,"context_line":""},{"line_number":58,"context_line":".. note::"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_2003d111","line":55,"range":{"start_line":54,"start_character":62,"end_line":55,"end_character":65},"in_reply_to":"5f7c97a3_45e5bf09","updated":"2018-05-17 21:19:48.000000000","message":"No, because they\u0027ll be using the older microversion where there *was* no generation field.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d615746cc8d85c7027106fe57123eae3a649fef0","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    refer to the microversion directly preceding the one added for this new"},{"line_number":63,"context_line":"    functionality."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":".. warning::"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    In all cases, it is absolutely **NOT SAFE** to create and modify"},{"line_number":68,"context_line":"    allocations for a consumer using different microversions. The only way to"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_05c82772","line":65,"updated":"2018-05-17 19:41:07.000000000","message":"I don\u0027t really understand the need for this warning. Is this just trying to cover our butts to say that doing the old thing and doing the new thing for the same consumer could be bad? Because shouldn\u0027t I be able to do both 1.X and 1.X+1 since, assuming all other things equal wrt the PUT /allocations/{consumer_uuid} for 1.X+1, there is no behavior change in the API.\n\n\u003clater\u003e\n\nOK I see the case on L127. That makes sense. The warning here is a bit confusing given 1.X and 1.X+1 should be fine, but I get the point.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"812fdb1c3632a95950236329b24e14d573299b1d","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    refer to the microversion directly preceding the one added for this new"},{"line_number":63,"context_line":"    functionality."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":".. warning::"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    In all cases, it is absolutely **NOT SAFE** to create and modify"},{"line_number":68,"context_line":"    allocations for a consumer using different microversions. The only way to"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_5b0e0033","line":65,"in_reply_to":"5f7c97a3_05c82772","updated":"2018-05-17 21:19:48.000000000","message":"The warning talks about 1.X-1, not 1.X+1.  Agree that from the perspective of this document, 1.X+1 isn\u0027t different than 1.X.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d615746cc8d85c7027106fe57123eae3a649fef0","unresolved":false,"context_lines":[{"line_number":65,"context_line":".. warning::"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    In all cases, it is absolutely **NOT SAFE** to create and modify"},{"line_number":68,"context_line":"    allocations for a consumer using different microversions. The only way to"},{"line_number":69,"context_line":"    safely modify allocations for a consumer and satisfy expectations you have"},{"line_number":70,"context_line":"    regarding the prior existence (or lack of existence) of those allocations"},{"line_number":71,"context_line":"    is to always use microversion 1.X when calling allocations API endpoints."}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_05f2679b","line":68,"range":{"start_line":68,"start_character":37,"end_line":68,"end_character":60},"updated":"2018-05-17 19:41:07.000000000","message":"Maybe this should just say, \"using different microversions where one is \u003c1.8\"?","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"812fdb1c3632a95950236329b24e14d573299b1d","unresolved":false,"context_lines":[{"line_number":65,"context_line":".. warning::"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    In all cases, it is absolutely **NOT SAFE** to create and modify"},{"line_number":68,"context_line":"    allocations for a consumer using different microversions. The only way to"},{"line_number":69,"context_line":"    safely modify allocations for a consumer and satisfy expectations you have"},{"line_number":70,"context_line":"    regarding the prior existence (or lack of existence) of those allocations"},{"line_number":71,"context_line":"    is to always use microversion 1.X when calling allocations API endpoints."}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_fb9cac6b","line":68,"range":{"start_line":68,"start_character":37,"end_line":68,"end_character":60},"in_reply_to":"5f7c97a3_05f2679b","updated":"2018-05-17 21:19:48.000000000","message":"Actually it should be any microversion \u003c1.X.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d615746cc8d85c7027106fe57123eae3a649fef0","unresolved":false,"context_lines":[{"line_number":82,"context_line":"When there **ARE NO** existing allocation records that referenced this"},{"line_number":83,"context_line":"consumer UUID, the call will exhibit the following behavior:"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"* Microversion \u003c1.8: always succeeds, and no consumer record is created since"},{"line_number":86,"context_line":"  ``project_id`` and ``user_id`` will be missing from the request"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, and consumer record is always"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_e58deb31","line":85,"range":{"start_line":85,"start_character":38,"end_line":85,"end_character":71},"updated":"2018-05-17 19:41:07.000000000","message":"OK because of this check:\n\nhttps://github.com/openstack/nova/blob/050e9202f69b6eeb23026b7350eeb8821ca9f1cc/nova/api/openstack/placement/objects/resource_provider.py#L1905\n\nright?","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"812fdb1c3632a95950236329b24e14d573299b1d","unresolved":false,"context_lines":[{"line_number":82,"context_line":"When there **ARE NO** existing allocation records that referenced this"},{"line_number":83,"context_line":"consumer UUID, the call will exhibit the following behavior:"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"* Microversion \u003c1.8: always succeeds, and no consumer record is created since"},{"line_number":86,"context_line":"  ``project_id`` and ``user_id`` will be missing from the request"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, and consumer record is always"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_9b49f88c","line":85,"range":{"start_line":85,"start_character":38,"end_line":85,"end_character":71},"in_reply_to":"5f7c97a3_e58deb31","updated":"2018-05-17 21:19:48.000000000","message":"right","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d615746cc8d85c7027106fe57123eae3a649fef0","unresolved":false,"context_lines":[{"line_number":86,"context_line":"  ``project_id`` and ``user_id`` will be missing from the request"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, and consumer record is always"},{"line_number":89,"context_line":"  created since ``project_id`` and ``user_id`` will always be present. A"},{"line_number":90,"context_line":"  generation will be created for this new consumer record"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"* Microversion 1.X: A new ``consumer_generation`` field will be required in the"},{"line_number":93,"context_line":"  request payload. It will be required to be ``None`` in order to indicate the"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_45a13f95","line":90,"range":{"start_line":89,"start_character":71,"end_line":90,"end_character":57},"updated":"2018-05-17 19:41:07.000000000","message":"And the generation will just auto-increment and will overwrite whatever allocations existed, which is the unsafe thing we\u0027re trying to guard against, right?","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"812fdb1c3632a95950236329b24e14d573299b1d","unresolved":false,"context_lines":[{"line_number":86,"context_line":"  ``project_id`` and ``user_id`` will be missing from the request"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, and consumer record is always"},{"line_number":89,"context_line":"  created since ``project_id`` and ``user_id`` will always be present. A"},{"line_number":90,"context_line":"  generation will be created for this new consumer record"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"* Microversion 1.X: A new ``consumer_generation`` field will be required in the"},{"line_number":93,"context_line":"  request payload. It will be required to be ``None`` in order to indicate the"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_5b2040b1","line":90,"range":{"start_line":89,"start_character":71,"end_line":90,"end_character":57},"in_reply_to":"5f7c97a3_45a13f95","updated":"2018-05-17 21:19:48.000000000","message":"In this case there\u0027s nothing to overwrite (the allocation record is being created afresh).  First and second bullets in the next section are where the unsafe thing happens.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"245b4bcbbae2cf437cecacde66dbb1c205f46fef","unresolved":false,"context_lines":[{"line_number":105,"context_line":"In this case, the call will exhibit the following behavior:"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"* Microversion \u003c1.8: always succeeds, and no consumer record is created since"},{"line_number":108,"context_line":"  ``project_id`` and ``user_id`` will be missing from the request"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, and a new consumer record is"},{"line_number":111,"context_line":"  always created since ``project_id`` and ``user_id`` will always be present. A"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_96e0effc","line":108,"updated":"2018-05-17 21:23:02.000000000","message":"This right here is not correct with the current proposed code.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"331ad85e7caed9781747a1a9c5a533d2d82c69a8","unresolved":false,"context_lines":[{"line_number":105,"context_line":"In this case, the call will exhibit the following behavior:"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"* Microversion \u003c1.8: always succeeds, and no consumer record is created since"},{"line_number":108,"context_line":"  ``project_id`` and ``user_id`` will be missing from the request"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, and a new consumer record is"},{"line_number":111,"context_line":"  always created since ``project_id`` and ``user_id`` will always be present. A"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_9638ef3d","line":108,"in_reply_to":"5f7c97a3_96e0effc","updated":"2018-05-17 21:34:14.000000000","message":"Oh.  Yeah.\n\nhttps://review.openstack.org/#/c/567678/4//COMMIT_MSG@18","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d615746cc8d85c7027106fe57123eae3a649fef0","unresolved":false,"context_lines":[{"line_number":111,"context_line":"  always created since ``project_id`` and ``user_id`` will always be present. A"},{"line_number":112,"context_line":"  generation will be created for this new consumer record"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"* Microversion 1.X: A new ``consumer_generation`` field will be required in the"},{"line_number":115,"context_line":"  request payload. It will be required to be ``None`` in order to indicate the"},{"line_number":116,"context_line":"  caller expects that this is a new consumer."},{"line_number":117,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_25c1a32f","line":114,"range":{"start_line":114,"start_character":28,"end_line":114,"end_character":47},"updated":"2018-05-17 19:41:07.000000000","message":"I\u0027m assuming this is consumer_generation so as to not be confused with \"generation\" which is on the GET /resource_providers API, and since PUT /allocations/{consumer_id} has both consumer and RPs in it, we don\u0027t want to confuse what the generation is for.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"812fdb1c3632a95950236329b24e14d573299b1d","unresolved":false,"context_lines":[{"line_number":111,"context_line":"  always created since ``project_id`` and ``user_id`` will always be present. A"},{"line_number":112,"context_line":"  generation will be created for this new consumer record"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"* Microversion 1.X: A new ``consumer_generation`` field will be required in the"},{"line_number":115,"context_line":"  request payload. It will be required to be ``None`` in order to indicate the"},{"line_number":116,"context_line":"  caller expects that this is a new consumer."},{"line_number":117,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_f63363f5","line":114,"range":{"start_line":114,"start_character":28,"end_line":114,"end_character":47},"in_reply_to":"5f7c97a3_25c1a32f","updated":"2018-05-17 21:19:48.000000000","message":"Believe it or not, this is really consistent.\n\nWe call resource provider generation \u0027generation\u0027 when the REST noun being addressed is a resource provider; otherwise we call it \u0027resource_provider_generation\u0027.  Since there is no \u0027consumer\u0027 noun (the noun in question is \u0027allocation\u0027) we call it \u0027consumer_generation\u0027.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d615746cc8d85c7027106fe57123eae3a649fef0","unresolved":false,"context_lines":[{"line_number":112,"context_line":"  generation will be created for this new consumer record"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"* Microversion 1.X: A new ``consumer_generation`` field will be required in the"},{"line_number":115,"context_line":"  request payload. It will be required to be ``None`` in order to indicate the"},{"line_number":116,"context_line":"  caller expects that this is a new consumer."},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"Existing allocation records, existing consumer record for the consumer"},{"line_number":119,"context_line":"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_85e517df","line":116,"range":{"start_line":115,"start_character":19,"end_line":116,"end_character":45},"updated":"2018-05-17 19:41:07.000000000","message":"What happens if I pass None but there is a consumer for this allocation and it\u0027s got a non-None generation? 400?\n\n\u003clater\u003e\n\nI see L149 below answers this, it\u0027s a 409 response.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"812fdb1c3632a95950236329b24e14d573299b1d","unresolved":false,"context_lines":[{"line_number":112,"context_line":"  generation will be created for this new consumer record"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"* Microversion 1.X: A new ``consumer_generation`` field will be required in the"},{"line_number":115,"context_line":"  request payload. It will be required to be ``None`` in order to indicate the"},{"line_number":116,"context_line":"  caller expects that this is a new consumer."},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"Existing allocation records, existing consumer record for the consumer"},{"line_number":119,"context_line":"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_d650a70d","line":116,"range":{"start_line":115,"start_character":19,"end_line":116,"end_character":45},"in_reply_to":"5f7c97a3_85e517df","updated":"2018-05-17 21:19:48.000000000","message":"Yup.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d615746cc8d85c7027106fe57123eae3a649fef0","unresolved":false,"context_lines":[{"line_number":201,"context_line":"When there **IS** an existing consumer record, the call will exhibit the"},{"line_number":202,"context_line":"following behavior:"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"* Microversion 1.13 - 1.X-1: always succeeds, the existing consumer records"},{"line_number":205,"context_line":"  will have their generation automatically incremented with no protection"},{"line_number":206,"context_line":"  against concurrent updates"},{"line_number":207,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_858197c6","line":204,"updated":"2018-05-17 19:41:07.000000000","message":"Isn\u0027t this different than L128 above which says, \"There will continue to be a\n  consumer record, since the allocations were originally created on or after\n  microversion 1.8. However, the generation will **NOT** be incremented for the\n  consumer record.\"","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"812fdb1c3632a95950236329b24e14d573299b1d","unresolved":false,"context_lines":[{"line_number":201,"context_line":"When there **IS** an existing consumer record, the call will exhibit the"},{"line_number":202,"context_line":"following behavior:"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"* Microversion 1.13 - 1.X-1: always succeeds, the existing consumer records"},{"line_number":205,"context_line":"  will have their generation automatically incremented with no protection"},{"line_number":206,"context_line":"  against concurrent updates"},{"line_number":207,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_766e73ca","line":204,"in_reply_to":"5f7c97a3_858197c6","updated":"2018-05-17 21:19:48.000000000","message":"No, this one corresponds with the next bullet (L143-5)","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"a625fd73e3d8b21a002258410d387e525d3765b0","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":"There are no changes to ``DELETE /allocations/{uuid}``. We were unable to find"},{"line_number":222,"context_line":"a way to supply a consumer generation in the ``DELETE /allocations/{uuid}``"},{"line_number":223,"context_line":"call."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"Generation-safe deletions need to be done via PUT/POST with an empty"},{"line_number":226,"context_line":"allocations dict."}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_db620217","line":223,"updated":"2018-05-05 11:43:12.000000000","message":"I would appreciate if there is more explanation about this.\n\nOkay, looking at the API doc, I assume this is because that \"generation\" is for each allocation of the consumer but DELETE applies to every allocations without specifying which allocation to delete?\n\nIn that case, DELETE API is always generation-unsafe... then should we deprecate or remove this DELETE API in the future?","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d615746cc8d85c7027106fe57123eae3a649fef0","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":"There are no changes to ``DELETE /allocations/{uuid}``. We were unable to find"},{"line_number":222,"context_line":"a way to supply a consumer generation in the ``DELETE /allocations/{uuid}``"},{"line_number":223,"context_line":"call."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"Generation-safe deletions need to be done via PUT/POST with an empty"},{"line_number":226,"context_line":"allocations dict."}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_e5f3ab72","line":223,"in_reply_to":"5f7c97a3_16c19ae5","updated":"2018-05-17 19:41:07.000000000","message":"You can specify query parameters with DELETE, and I\u0027m aware of one compute API that requires this:\n\nhttps://developer.openstack.org/api-ref/compute/#delete-assisted-volume-snapshot\n\nIt\u0027s a mess and we probably shouldn\u0027t propagate it, but it\u0027s possible:\n\nDELETE /allocations/{consumer}?consumer_generation\u003d5","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ec3fbab9b4bdbfaeacfd1b8d7097a6b0cc982a97","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":"There are no changes to ``DELETE /allocations/{uuid}``. We were unable to find"},{"line_number":222,"context_line":"a way to supply a consumer generation in the ``DELETE /allocations/{uuid}``"},{"line_number":223,"context_line":"call."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"Generation-safe deletions need to be done via PUT/POST with an empty"},{"line_number":226,"context_line":"allocations dict."}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_16c19ae5","line":223,"in_reply_to":"5f7c97a3_db620217","updated":"2018-05-14 14:07:01.000000000","message":"We really can\u0027t deprecate/remove it without bumping the minimum supported microversion at some point.\n\nBesides, it\u0027s useful to keep around for consumers who don\u0027t care about generations (e.g. consumers who know they\u0027re single-threaded).","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"812fdb1c3632a95950236329b24e14d573299b1d","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":"There are no changes to ``DELETE /allocations/{uuid}``. We were unable to find"},{"line_number":222,"context_line":"a way to supply a consumer generation in the ``DELETE /allocations/{uuid}``"},{"line_number":223,"context_line":"call."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"Generation-safe deletions need to be done via PUT/POST with an empty"},{"line_number":226,"context_line":"allocations dict."}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_165fff0e","line":223,"in_reply_to":"5f7c97a3_e5f3ab72","updated":"2018-05-17 21:19:48.000000000","message":"Right, that\u0027s mentioned on L236-7 along with other alternatives.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d615746cc8d85c7027106fe57123eae3a649fef0","unresolved":false,"context_lines":[{"line_number":300,"context_line":"  return a 409 Conflict if the supplied generation does not match the current"},{"line_number":301,"context_line":"  value in the consumers table. See above for detailed explanation of the"},{"line_number":302,"context_line":"  expected behavior."},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"  In addition to the above changes, we will also be modifying the PUT method to"},{"line_number":305,"context_line":"  accept empty allocations. This will allow similar behaviour to POST and"},{"line_number":306,"context_line":"  facilitate a concurrent-update-safe DELETE operation for allocations."},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"* /allocations - The POST method accepts multiple allocations, and the schema"},{"line_number":309,"context_line":"  will be modified in a new version to add a required value for"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_65ad5b30","line":306,"range":{"start_line":303,"start_character":0,"end_line":306,"end_character":71},"updated":"2018-05-17 19:41:07.000000000","message":"This is also how PUT /resource_providers/{uuid}/inventories works, and was the only thing available to clear inventories for a resource provider prior to DELETE /resource_providers/{uuid}/inventories in 1.5.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d615746cc8d85c7027106fe57123eae3a649fef0","unresolved":false,"context_lines":[{"line_number":334,"context_line":"        \"consumer_generation\""},{"line_number":335,"context_line":"    ]"},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"POST will be changed to require consumer generation per consumer section."},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"Security impact"},{"line_number":340,"context_line":"---------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_05aa6718","line":337,"range":{"start_line":337,"start_character":32,"end_line":337,"end_character":51},"updated":"2018-05-17 19:41:07.000000000","message":"nit: ``consumer_generation``","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"812fdb1c3632a95950236329b24e14d573299b1d","unresolved":false,"context_lines":[{"line_number":334,"context_line":"        \"consumer_generation\""},{"line_number":335,"context_line":"    ]"},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"POST will be changed to require consumer generation per consumer section."},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"Security impact"},{"line_number":340,"context_line":"---------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_56aa57d2","line":337,"range":{"start_line":337,"start_character":32,"end_line":337,"end_character":51},"in_reply_to":"5f7c97a3_05aa6718","updated":"2018-05-17 21:19:48.000000000","message":"Done","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d615746cc8d85c7027106fe57123eae3a649fef0","unresolved":false,"context_lines":[{"line_number":398,"context_line":"* Add the ``generation`` column to the consumers table, and create the"},{"line_number":399,"context_line":"  corresponding migration script."},{"line_number":400,"context_line":""},{"line_number":401,"context_line":"* Modify all the allocation handler code to increment the consumer generation"},{"line_number":402,"context_line":"  on all changes."},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"* Modify input \u0026 output schemas/payloads to include the generation."},{"line_number":405,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_257c43b4","line":402,"range":{"start_line":401,"start_character":44,"end_line":402,"end_character":17},"updated":"2018-05-17 19:41:07.000000000","message":"Not all scenarios increment the consumer generation, e.g. L128.","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"812fdb1c3632a95950236329b24e14d573299b1d","unresolved":false,"context_lines":[{"line_number":398,"context_line":"* Add the ``generation`` column to the consumers table, and create the"},{"line_number":399,"context_line":"  corresponding migration script."},{"line_number":400,"context_line":""},{"line_number":401,"context_line":"* Modify all the allocation handler code to increment the consumer generation"},{"line_number":402,"context_line":"  on all changes."},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"* Modify input \u0026 output schemas/payloads to include the generation."},{"line_number":405,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_76f19301","line":402,"range":{"start_line":401,"start_character":44,"end_line":402,"end_character":17},"in_reply_to":"5f7c97a3_257c43b4","updated":"2018-05-17 21:19:48.000000000","message":"Done","commit_id":"6eda79f26c74b383a0700059b1eabccdcab45dc0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b458f561cc3dd6d7971259cd0a6b1c1c58410dd4","unresolved":false,"context_lines":[{"line_number":377,"context_line":"Upgrade impact"},{"line_number":378,"context_line":"--------------"},{"line_number":379,"context_line":""},{"line_number":380,"context_line":"None"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"Implementation"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_7697533c","line":380,"updated":"2018-05-17 21:27:12.000000000","message":"Maybe here or in \u0027other deployer impact\u0027, per my (poor) understanding of the proposed code, for old allocations where there is no consumer record (or new allocations with microversion \u003c1.8), we\u0027ll have a config option to always create those and if there is no project_id/user_id passed in, we\u0027ll pull them from config so the operator can either put in some sentinel values to distinguish the special case if they are pulling /usages, or they (I\u0027m assuming more likely) would use the admin user\u0027s project_id/user_id in those config option values to signal it\u0027s kind of an admin-thing that\u0027s taken over even if the allocations are owned by a consumer that\u0027s a non-admin user in a different project.","commit_id":"2435221ec8a69cd4230e16f082ca5051a01be9f6"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"d16aff5ad245eb3ebe317ce6402484e52e5816e7","unresolved":false,"context_lines":[{"line_number":377,"context_line":"Upgrade impact"},{"line_number":378,"context_line":"--------------"},{"line_number":379,"context_line":""},{"line_number":380,"context_line":"None"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"Implementation"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_ab3d50de","line":380,"in_reply_to":"5f7c97a3_7697533c","updated":"2018-05-21 17:46:17.000000000","message":"Done","commit_id":"2435221ec8a69cd4230e16f082ca5051a01be9f6"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"331ad85e7caed9781747a1a9c5a533d2d82c69a8","unresolved":false,"context_lines":[{"line_number":377,"context_line":"Upgrade impact"},{"line_number":378,"context_line":"--------------"},{"line_number":379,"context_line":""},{"line_number":380,"context_line":"None"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"Implementation"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_f64603c1","line":380,"in_reply_to":"5f7c97a3_7697533c","updated":"2018-05-17 21:34:14.000000000","message":"Yeah, as Dan pointed out, that\u0027s more or less what the code proposed in Jay\u0027s series is doing.","commit_id":"2435221ec8a69cd4230e16f082ca5051a01be9f6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"93a26fbd710a7aebbc5edd067d1ffa6c129f6ede","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":".. warning::"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    In all cases, it is absolutely **NOT SAFE** to create and modify"},{"line_number":68,"context_line":"    allocations for a consumer using different microversions. The only way to"},{"line_number":69,"context_line":"    safely modify allocations for a consumer and satisfy expectations you have"},{"line_number":70,"context_line":"    regarding the prior existence (or lack of existence) of those allocations"},{"line_number":71,"context_line":"    is to always use microversion 1.X when calling allocations API endpoints."},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"In order to ensure that a consumer record exists for all allocation records, we"},{"line_number":74,"context_line":"will add an online data migration that will find any consumer UUIDs in the"}],"source_content_type":"text/x-rst","patch_set":5,"id":"5f7c97a3_eb110755","line":71,"range":{"start_line":67,"start_character":3,"end_line":71,"end_character":77},"updated":"2018-05-21 17:59:10.000000000","message":"I guess I thought this was going to go away in the latest revision.\n\nI think it\u0027s very strange for us to say this, given that we may very well have scheduler and compute using different microversions to create (and at least access) allocations during an upgrade. Further, after one upgrade and a subsequent resize or something, you\u0027d definitely have conductor and/or scheduler modifying allocations at a different microversion than the one they were created with.\n\nWith this, do you really just mean to indicate that two clients operating on the same allocation, one of which using a pre-generation microversion would be unsafe? If so, could we say that instead of what you have here?","commit_id":"8a5692d2b1c24c1ce40eab4f24ecbf5496dffae8"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b40126a3e429afa55c781a5e687e760e8623eb35","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":".. warning::"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    In all cases, it is absolutely **NOT SAFE** to create and modify"},{"line_number":68,"context_line":"    allocations for a consumer using different microversions. The only way to"},{"line_number":69,"context_line":"    safely modify allocations for a consumer and satisfy expectations you have"},{"line_number":70,"context_line":"    regarding the prior existence (or lack of existence) of those allocations"},{"line_number":71,"context_line":"    is to always use microversion 1.X when calling allocations API endpoints."},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"In order to ensure that a consumer record exists for all allocation records, we"},{"line_number":74,"context_line":"will add an online data migration that will find any consumer UUIDs in the"}],"source_content_type":"text/x-rst","patch_set":5,"id":"5f7c97a3_2b7dbf6d","line":71,"range":{"start_line":67,"start_character":3,"end_line":71,"end_character":77},"in_reply_to":"5f7c97a3_eb110755","updated":"2018-05-21 18:54:57.000000000","message":"\u003e With this, do you really just mean to indicate that two clients\n \u003e operating on the same allocation, one of which using a\n \u003e pre-generation microversion would be unsafe? If so, could we say\n \u003e that instead of what you have here?\n\nYes, that\u0027s precisely what I\u0027m trying to say. Thank you! I\u0027ll update.","commit_id":"8a5692d2b1c24c1ce40eab4f24ecbf5496dffae8"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"93a26fbd710a7aebbc5edd067d1ffa6c129f6ede","unresolved":false,"context_lines":[{"line_number":90,"context_line":"When there **ARE NO** existing allocation records that referenced this"},{"line_number":91,"context_line":"consumer UUID, the call will exhibit the following behavior:"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"* Microversion \u003c1.8: always succeeds, and no consumer record is created since"},{"line_number":94,"context_line":"  ``project_id`` and ``user_id`` will be missing from the request"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, and consumer record is always"}],"source_content_type":"text/x-rst","patch_set":5,"id":"5f7c97a3_eb3a67cb","line":93,"range":{"start_line":93,"start_character":42,"end_line":93,"end_character":60},"updated":"2018-05-21 17:59:10.000000000","message":"...but we should create the record, using the default user/project info right? Otherwise we\u0027re just creating dirty data that will have to be constantly fixed up the migration.","commit_id":"8a5692d2b1c24c1ce40eab4f24ecbf5496dffae8"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b40126a3e429afa55c781a5e687e760e8623eb35","unresolved":false,"context_lines":[{"line_number":90,"context_line":"When there **ARE NO** existing allocation records that referenced this"},{"line_number":91,"context_line":"consumer UUID, the call will exhibit the following behavior:"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"* Microversion \u003c1.8: always succeeds, and no consumer record is created since"},{"line_number":94,"context_line":"  ``project_id`` and ``user_id`` will be missing from the request"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, and consumer record is always"}],"source_content_type":"text/x-rst","patch_set":5,"id":"5f7c97a3_4b803b47","line":93,"range":{"start_line":93,"start_character":42,"end_line":93,"end_character":60},"in_reply_to":"5f7c97a3_eb3a67cb","updated":"2018-05-21 18:54:57.000000000","message":"Done","commit_id":"8a5692d2b1c24c1ce40eab4f24ecbf5496dffae8"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"93a26fbd710a7aebbc5edd067d1ffa6c129f6ede","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"In this case, the call will exhibit the following behavior:"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"* Microversion \u003c1.8: always succeeds, and no consumer record is created since"},{"line_number":116,"context_line":"  ``project_id`` and ``user_id`` will be missing from the request"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, and a new consumer record is"}],"source_content_type":"text/x-rst","patch_set":5,"id":"5f7c97a3_4b591b33","line":115,"range":{"start_line":115,"start_character":42,"end_line":115,"end_character":60},"updated":"2018-05-21 17:59:10.000000000","message":"Ditto","commit_id":"8a5692d2b1c24c1ce40eab4f24ecbf5496dffae8"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b40126a3e429afa55c781a5e687e760e8623eb35","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"In this case, the call will exhibit the following behavior:"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"* Microversion \u003c1.8: always succeeds, and no consumer record is created since"},{"line_number":116,"context_line":"  ``project_id`` and ``user_id`` will be missing from the request"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"* Microversion 1.8 - 1.X-1: always succeeds, and a new consumer record is"}],"source_content_type":"text/x-rst","patch_set":5,"id":"5f7c97a3_eb96e794","line":115,"range":{"start_line":115,"start_character":42,"end_line":115,"end_character":60},"in_reply_to":"5f7c97a3_4b591b33","updated":"2018-05-21 18:54:57.000000000","message":"Done","commit_id":"8a5692d2b1c24c1ce40eab4f24ecbf5496dffae8"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"93a26fbd710a7aebbc5edd067d1ffa6c129f6ede","unresolved":false,"context_lines":[{"line_number":135,"context_line":"* Microversion \u003c1.8: always succeeds and always overwrites the consumer\u0027s"},{"line_number":136,"context_line":"  allocations entirely, with no protection. There will continue to be a"},{"line_number":137,"context_line":"  consumer record, since the allocations were originally created on or after"},{"line_number":138,"context_line":"  microversion 1.8. However, the generation will **NOT** be incremented for the"},{"line_number":139,"context_line":"  consumer record."},{"line_number":140,"context_line":""},{"line_number":141,"context_line":".. warning::"},{"line_number":142,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"5f7c97a3_6b75f797","line":139,"range":{"start_line":138,"start_character":20,"end_line":139,"end_character":18},"updated":"2018-05-21 17:59:10.000000000","message":"Hmm, why is this? Why not increment it so that any \u003e\u003d1.x clients will know that it has since changed? Why not just do the \"assume the client provided the latest\" behavior for those requests?","commit_id":"8a5692d2b1c24c1ce40eab4f24ecbf5496dffae8"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b40126a3e429afa55c781a5e687e760e8623eb35","unresolved":false,"context_lines":[{"line_number":135,"context_line":"* Microversion \u003c1.8: always succeeds and always overwrites the consumer\u0027s"},{"line_number":136,"context_line":"  allocations entirely, with no protection. There will continue to be a"},{"line_number":137,"context_line":"  consumer record, since the allocations were originally created on or after"},{"line_number":138,"context_line":"  microversion 1.8. However, the generation will **NOT** be incremented for the"},{"line_number":139,"context_line":"  consumer record."},{"line_number":140,"context_line":""},{"line_number":141,"context_line":".. warning::"},{"line_number":142,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"5f7c97a3_cb70cb0b","line":139,"range":{"start_line":138,"start_character":20,"end_line":139,"end_character":18},"in_reply_to":"5f7c97a3_6b75f797","updated":"2018-05-21 18:54:57.000000000","message":"yeah, totally right. I will correct.","commit_id":"8a5692d2b1c24c1ce40eab4f24ecbf5496dffae8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f26abd0f5551b5ad404a05223d472240b0f7c2ef","unresolved":false,"context_lines":[{"line_number":46,"context_line":"all Placement responses that provide data for a consumer, and must be included"},{"line_number":47,"context_line":"in any request to placement that changes allocations for that consumer. As is"},{"line_number":48,"context_line":"the case for updates to ResourceProviders, if the supplied consumer generation"},{"line_number":49,"context_line":"doesn\u0027t match the the current value, Placement will reject the request and"},{"line_number":50,"context_line":"return a 409 Conflict response. Since in many cases there will not be an"},{"line_number":51,"context_line":"existing consumer record, the request would supply ``None`` as the consumer"},{"line_number":52,"context_line":"generation."}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_0e5a514f","line":49,"range":{"start_line":49,"start_character":18,"end_line":49,"end_character":21},"updated":"2018-05-21 21:01:07.000000000","message":"re-added this from PS4","commit_id":"df1e0ba1a474760d5e6259f2b09a5a0cda5bc842"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"76977849c6f2ab483cf4b0df2dc76e8451aae491","unresolved":false,"context_lines":[{"line_number":108,"context_line":"this consumer UUID, however there **ARE NO** consumer records that reference"},{"line_number":109,"context_line":"the consumer UUID. This means the allocation records were created prior to"},{"line_number":110,"context_line":"microversion 1.8 *and* the online data migration that creates incomplete"},{"line_number":111,"context_line":"consumer records has *not yet run*."},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"In this case, the call will exhibit the following behavior:"},{"line_number":114,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_ee02753e","line":111,"updated":"2018-05-21 20:29:40.000000000","message":"We could return the CONF value here instead of returning None to make it consistent, but not a huge deal.","commit_id":"df1e0ba1a474760d5e6259f2b09a5a0cda5bc842"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f26abd0f5551b5ad404a05223d472240b0f7c2ef","unresolved":false,"context_lines":[{"line_number":330,"context_line":"        \"consumer_generation\""},{"line_number":331,"context_line":"    ]"},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"POST will be changed to require consumer generation per consumer section."},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"Security impact"},{"line_number":336,"context_line":"---------------"}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_0e1fb170","line":333,"range":{"start_line":333,"start_character":32,"end_line":333,"end_character":51},"updated":"2018-05-21 21:01:07.000000000","message":"``consumer_generation``","commit_id":"df1e0ba1a474760d5e6259f2b09a5a0cda5bc842"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f26abd0f5551b5ad404a05223d472240b0f7c2ef","unresolved":false,"context_lines":[{"line_number":380,"context_line":"particular project or user UUID to use when creating missing consumer records"},{"line_number":381,"context_line":"for allocations that were created prior to microversion 1.8."},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"Running the existing ``nova-manage db online_data_migrations`` CLI command will"},{"line_number":384,"context_line":"automatically run this online data migration to create missing consumer"},{"line_number":385,"context_line":"records."},{"line_number":386,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_71fe4a06","line":383,"updated":"2018-05-21 21:01:07.000000000","message":"Dan suggested that we also do this when the compute service starts up, I think when we\u0027re in this code path:\n\nhttps://github.com/openstack/nova/blob/d78055df0e39b53fd481c53429ba77f8c1e1ab09/nova/compute/resource_tracker.py#L1243","commit_id":"df1e0ba1a474760d5e6259f2b09a5a0cda5bc842"}]}
