)]}'
{"specs/rocky/approved/add-consumer-generation.rst":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ddbf4ba45280c79d0eb39b53f1bda56a515376f4","unresolved":false,"context_lines":[{"line_number":8,"context_line":"Add Generation to Consumers"},{"line_number":9,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Include the URL of your launchpad blueprint:"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"https://blueprints.launchpad.net/nova/+spec/add-consumer-generation"},{"line_number":14,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_0f3c84c6","line":11,"updated":"2018-03-27 17:48:29.000000000","message":"remove this line","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9340fb804979b12f2a8a02fe8afdd5ecb3dd7ff5","unresolved":false,"context_lines":[{"line_number":8,"context_line":"Add Generation to Consumers"},{"line_number":9,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Include the URL of your launchpad blueprint:"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"https://blueprints.launchpad.net/nova/+spec/add-consumer-generation"},{"line_number":14,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_a898ee1a","line":11,"in_reply_to":"bf659307_0f3c84c6","updated":"2018-03-27 21:10:41.000000000","message":"Done","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7056aad7c2e99e496f83b94b24b47d5e99abfd42","unresolved":false,"context_lines":[{"line_number":42,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"A ``generation`` column will be added to the ``consumers`` table. This will be"},{"line_number":45,"context_line":"an autoincrementing integer, just like the generation column in the"},{"line_number":46,"context_line":"resource_providers table. This value will be included in all Placement"},{"line_number":47,"context_line":"responses that provide data for a consumer, and must be included in any request"},{"line_number":48,"context_line":"to placement that changes allocations for that consumer. As is the case for"}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_afca3817","line":45,"range":{"start_line":45,"start_character":3,"end_line":45,"end_character":27},"updated":"2018-03-27 18:04:04.000000000","message":"Wouldn\u0027t mind an explicit mention that the value is intended to be opaque to the API consumer, who should not be assuming anything about it (that it\u0027s an int, that it starts at zero, that it increments by one, etc.).","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9340fb804979b12f2a8a02fe8afdd5ecb3dd7ff5","unresolved":false,"context_lines":[{"line_number":42,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"A ``generation`` column will be added to the ``consumers`` table. This will be"},{"line_number":45,"context_line":"an autoincrementing integer, just like the generation column in the"},{"line_number":46,"context_line":"resource_providers table. This value will be included in all Placement"},{"line_number":47,"context_line":"responses that provide data for a consumer, and must be included in any request"},{"line_number":48,"context_line":"to placement that changes allocations for that consumer. As is the case for"}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_a8c1cee6","line":45,"range":{"start_line":45,"start_character":3,"end_line":45,"end_character":27},"in_reply_to":"bf659307_afca3817","updated":"2018-03-27 21:10:41.000000000","message":"Done","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"753a666f0415df5f89358efe0fa0c1356a79588e","unresolved":false,"context_lines":[{"line_number":60,"context_line":"We could modify the way that allocations are handled, and allow for a PATCH"},{"line_number":61,"context_line":"method to avoid accidentally overwriting another service\u0027s allocations. While"},{"line_number":62,"context_line":"this will also address the race condition, it was not favored by many in the"},{"line_number":63,"context_line":"discussions we had at the Rocky PTG."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"Data model impact"},{"line_number":66,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_7944ee1b","line":63,"updated":"2018-03-27 16:53:01.000000000","message":"This is not true, is it? You can still race with PATCH just as hard and would need some kind of consistent view marker for it.","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ddbf4ba45280c79d0eb39b53f1bda56a515376f4","unresolved":false,"context_lines":[{"line_number":60,"context_line":"We could modify the way that allocations are handled, and allow for a PATCH"},{"line_number":61,"context_line":"method to avoid accidentally overwriting another service\u0027s allocations. While"},{"line_number":62,"context_line":"this will also address the race condition, it was not favored by many in the"},{"line_number":63,"context_line":"discussions we had at the Rocky PTG."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"Data model impact"},{"line_number":66,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_8fb894c8","line":63,"in_reply_to":"bf659307_7944ee1b","updated":"2018-03-27 17:48:29.000000000","message":"Correct.","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"bc982c90acb0a2d6e75a3ce96596bd6025cadd19","unresolved":false,"context_lines":[{"line_number":60,"context_line":"We could modify the way that allocations are handled, and allow for a PATCH"},{"line_number":61,"context_line":"method to avoid accidentally overwriting another service\u0027s allocations. While"},{"line_number":62,"context_line":"this will also address the race condition, it was not favored by many in the"},{"line_number":63,"context_line":"discussions we had at the Rocky PTG."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"Data model impact"},{"line_number":66,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_4f091c2a","line":63,"in_reply_to":"bf659307_7944ee1b","updated":"2018-03-27 17:33:27.000000000","message":"Only if 2 processes were allocating the same resource classes for the same consumer at the same time. If that\u0027s going on, you have much bigger problems. The more realistic example of both Nova and Neutron allocating for the same instance would have them allocating completely different resource classes, so there would be no race.","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7056aad7c2e99e496f83b94b24b47d5e99abfd42","unresolved":false,"context_lines":[{"line_number":71,"context_line":"REST API impact"},{"line_number":72,"context_line":"---------------"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"* /allocations/\u003cconsumer_id\u003e - the GET method will be changed to return the"},{"line_number":75,"context_line":"  current generation value for the consumer."},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"* /allocations/\u003cconsumer_id\u003e - the PUT and DELETE methods will be changed to"},{"line_number":78,"context_line":"  require consumer generation, and will return a 409 Conflict if the supplied"},{"line_number":79,"context_line":"  generation does not match the current value in the consumers table."},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"* /allocations - the POST method will be changed to require a consumer"},{"line_number":82,"context_line":"  generation for each consumer_uuid value. It will return a 409 Conflict if the"},{"line_number":83,"context_line":"  supplied generation does not match the current value in the consumers table."},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"Security impact"},{"line_number":86,"context_line":"---------------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_8f31740e","line":83,"range":{"start_line":74,"start_character":0,"end_line":83,"end_character":78},"updated":"2018-03-27 18:04:04.000000000","message":"I agree with cdent that this spec should have examples of what the request \u0026 response payloads will look like when this value is included.\n\nOne detail on which we should certainly have the opportunity to bikeshed is the name of the new field in the JSON.  Shall it be \u0027consumer_generation\u0027, or does the API endpoint provide sufficient context that \u0027generation\u0027 works?","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9340fb804979b12f2a8a02fe8afdd5ecb3dd7ff5","unresolved":false,"context_lines":[{"line_number":71,"context_line":"REST API impact"},{"line_number":72,"context_line":"---------------"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"* /allocations/\u003cconsumer_id\u003e - the GET method will be changed to return the"},{"line_number":75,"context_line":"  current generation value for the consumer."},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"* /allocations/\u003cconsumer_id\u003e - the PUT and DELETE methods will be changed to"},{"line_number":78,"context_line":"  require consumer generation, and will return a 409 Conflict if the supplied"},{"line_number":79,"context_line":"  generation does not match the current value in the consumers table."},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"* /allocations - the POST method will be changed to require a consumer"},{"line_number":82,"context_line":"  generation for each consumer_uuid value. It will return a 409 Conflict if the"},{"line_number":83,"context_line":"  supplied generation does not match the current value in the consumers table."},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"Security impact"},{"line_number":86,"context_line":"---------------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_7ebe0c66","line":83,"range":{"start_line":74,"start_character":0,"end_line":83,"end_character":78},"in_reply_to":"bf659307_8f31740e","updated":"2018-03-27 21:10:41.000000000","message":"OK, added some sample JSON changes. And looking at it, \u0027consumer_generation\u0027 is both clearer and more consistent with \u0027resource_provider_generation\u0027.","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ddbf4ba45280c79d0eb39b53f1bda56a515376f4","unresolved":false,"context_lines":[{"line_number":113,"context_line":"Developer impact"},{"line_number":114,"context_line":"----------------"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"Developer of services that interact with placement will have to modify their"},{"line_number":117,"context_line":"code for allocating to specify the new microversion. They will also have to add"},{"line_number":118,"context_line":"handler code in the event that an allocation attempt returns a conflict."},{"line_number":119,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_4fe7dce5","line":116,"range":{"start_line":116,"start_character":8,"end_line":116,"end_character":9},"updated":"2018-03-27 17:48:29.000000000","message":"Developers","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9340fb804979b12f2a8a02fe8afdd5ecb3dd7ff5","unresolved":false,"context_lines":[{"line_number":113,"context_line":"Developer impact"},{"line_number":114,"context_line":"----------------"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"Developer of services that interact with placement will have to modify their"},{"line_number":117,"context_line":"code for allocating to specify the new microversion. They will also have to add"},{"line_number":118,"context_line":"handler code in the event that an allocation attempt returns a conflict."},{"line_number":119,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_beab441b","line":116,"range":{"start_line":116,"start_character":8,"end_line":116,"end_character":9},"in_reply_to":"bf659307_4fe7dce5","updated":"2018-03-27 21:10:41.000000000","message":"Done","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7056aad7c2e99e496f83b94b24b47d5e99abfd42","unresolved":false,"context_lines":[{"line_number":143,"context_line":""},{"line_number":144,"context_line":"* Modify all the allocation handler code to increment the consumer generation"},{"line_number":145,"context_line":"  on all changes."},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"* Add generation conflict checking that will return a 409 if generations don\u0027t"},{"line_number":148,"context_line":"  match."},{"line_number":149,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_0f2564c2","line":146,"updated":"2018-03-27 18:04:04.000000000","message":"* Modify input \u0026 output schemas/payloads to include the generation.","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9340fb804979b12f2a8a02fe8afdd5ecb3dd7ff5","unresolved":false,"context_lines":[{"line_number":143,"context_line":""},{"line_number":144,"context_line":"* Modify all the allocation handler code to increment the consumer generation"},{"line_number":145,"context_line":"  on all changes."},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"* Add generation conflict checking that will return a 409 if generations don\u0027t"},{"line_number":148,"context_line":"  match."},{"line_number":149,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_3e6df403","line":146,"in_reply_to":"bf659307_0f2564c2","updated":"2018-03-27 21:10:41.000000000","message":"Done","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7056aad7c2e99e496f83b94b24b47d5e99abfd42","unresolved":false,"context_lines":[{"line_number":159,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"Functional tests will be added to verify that consumer generation values are"},{"line_number":162,"context_line":"properly returned, and that any allocations for that consumer changes the"},{"line_number":163,"context_line":"generation.They will also verify that allocation request with a matching"},{"line_number":164,"context_line":"generation succeed, and those with a non-matching generation fail with a 409"},{"line_number":165,"context_line":"Conflict."}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_0f0ec43a","line":162,"range":{"start_line":162,"start_character":32,"end_line":162,"end_character":69},"updated":"2018-03-27 18:04:04.000000000","message":"allocation...changes or allocations...change","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9340fb804979b12f2a8a02fe8afdd5ecb3dd7ff5","unresolved":false,"context_lines":[{"line_number":159,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"Functional tests will be added to verify that consumer generation values are"},{"line_number":162,"context_line":"properly returned, and that any allocations for that consumer changes the"},{"line_number":163,"context_line":"generation.They will also verify that allocation request with a matching"},{"line_number":164,"context_line":"generation succeed, and those with a non-matching generation fail with a 409"},{"line_number":165,"context_line":"Conflict."}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_5e49c888","line":162,"range":{"start_line":162,"start_character":32,"end_line":162,"end_character":69},"in_reply_to":"bf659307_0f0ec43a","updated":"2018-03-27 21:10:41.000000000","message":"Done","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"753a666f0415df5f89358efe0fa0c1356a79588e","unresolved":false,"context_lines":[{"line_number":160,"context_line":""},{"line_number":161,"context_line":"Functional tests will be added to verify that consumer generation values are"},{"line_number":162,"context_line":"properly returned, and that any allocations for that consumer changes the"},{"line_number":163,"context_line":"generation.They will also verify that allocation request with a matching"},{"line_number":164,"context_line":"generation succeed, and those with a non-matching generation fail with a 409"},{"line_number":165,"context_line":"Conflict."},{"line_number":166,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_992ea241","line":163,"range":{"start_line":163,"start_character":0,"end_line":163,"end_character":15},"updated":"2018-03-27 16:53:01.000000000","message":"Steal an extra space from efried and put it here.","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7056aad7c2e99e496f83b94b24b47d5e99abfd42","unresolved":false,"context_lines":[{"line_number":160,"context_line":""},{"line_number":161,"context_line":"Functional tests will be added to verify that consumer generation values are"},{"line_number":162,"context_line":"properly returned, and that any allocations for that consumer changes the"},{"line_number":163,"context_line":"generation.They will also verify that allocation request with a matching"},{"line_number":164,"context_line":"generation succeed, and those with a non-matching generation fail with a 409"},{"line_number":165,"context_line":"Conflict."},{"line_number":166,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_92ff5700","line":163,"range":{"start_line":163,"start_character":38,"end_line":163,"end_character":56},"updated":"2018-03-27 18:04:04.000000000","message":"allocation requests","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9340fb804979b12f2a8a02fe8afdd5ecb3dd7ff5","unresolved":false,"context_lines":[{"line_number":160,"context_line":""},{"line_number":161,"context_line":"Functional tests will be added to verify that consumer generation values are"},{"line_number":162,"context_line":"properly returned, and that any allocations for that consumer changes the"},{"line_number":163,"context_line":"generation.They will also verify that allocation request with a matching"},{"line_number":164,"context_line":"generation succeed, and those with a non-matching generation fail with a 409"},{"line_number":165,"context_line":"Conflict."},{"line_number":166,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_7e312c0b","line":163,"range":{"start_line":163,"start_character":38,"end_line":163,"end_character":56},"in_reply_to":"bf659307_92ff5700","updated":"2018-03-27 21:10:41.000000000","message":"Done","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9340fb804979b12f2a8a02fe8afdd5ecb3dd7ff5","unresolved":false,"context_lines":[{"line_number":160,"context_line":""},{"line_number":161,"context_line":"Functional tests will be added to verify that consumer generation values are"},{"line_number":162,"context_line":"properly returned, and that any allocations for that consumer changes the"},{"line_number":163,"context_line":"generation.They will also verify that allocation request with a matching"},{"line_number":164,"context_line":"generation succeed, and those with a non-matching generation fail with a 409"},{"line_number":165,"context_line":"Conflict."},{"line_number":166,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_de54f823","line":163,"range":{"start_line":163,"start_character":0,"end_line":163,"end_character":15},"in_reply_to":"bf659307_992ea241","updated":"2018-03-27 21:10:41.000000000","message":"Done","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"bc982c90acb0a2d6e75a3ce96596bd6025cadd19","unresolved":false,"context_lines":[{"line_number":160,"context_line":""},{"line_number":161,"context_line":"Functional tests will be added to verify that consumer generation values are"},{"line_number":162,"context_line":"properly returned, and that any allocations for that consumer changes the"},{"line_number":163,"context_line":"generation.They will also verify that allocation request with a matching"},{"line_number":164,"context_line":"generation succeed, and those with a non-matching generation fail with a 409"},{"line_number":165,"context_line":"Conflict."},{"line_number":166,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_ef17d044","line":163,"range":{"start_line":163,"start_character":0,"end_line":163,"end_character":15},"in_reply_to":"bf659307_992ea241","updated":"2018-03-27 17:33:27.000000000","message":"I don\u0027t think he can spare it.","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"753a666f0415df5f89358efe0fa0c1356a79588e","unresolved":false,"context_lines":[{"line_number":171,"context_line":"The developer documentation for working with Placement will have to be updated"},{"line_number":172,"context_line":"to include information about using consumer generations, and that services"},{"line_number":173,"context_line":"using Placement should be updated to handle a 409 response when creating"},{"line_number":174,"context_line":"allocations."},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"References"},{"line_number":177,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_59b6cafc","line":174,"updated":"2018-03-27 16:53:01.000000000","message":"Do we need an explicit mention of api-ref updates either here or in the work items?","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"bc982c90acb0a2d6e75a3ce96596bd6025cadd19","unresolved":false,"context_lines":[{"line_number":171,"context_line":"The developer documentation for working with Placement will have to be updated"},{"line_number":172,"context_line":"to include information about using consumer generations, and that services"},{"line_number":173,"context_line":"using Placement should be updated to handle a 409 response when creating"},{"line_number":174,"context_line":"allocations."},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"References"},{"line_number":177,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_2f3708e6","line":174,"in_reply_to":"bf659307_59b6cafc","updated":"2018-03-27 17:33:27.000000000","message":"That\u0027s the sort of documentation update I was vaguely referring to.","commit_id":"0fad27d3d8d3a0af00565916edd1e26c995f4216"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6b0305b6696b0caa242a6d2c16bc1a6f7e9ea3f3","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"We could modify the way that allocations are handled, and allow for a PATCH"},{"line_number":60,"context_line":"method to avoid accidentally overwriting another service\u0027s allocations. While"},{"line_number":61,"context_line":"this will also address the race condition, it was not favored by many in the"},{"line_number":62,"context_line":"discussions we had at the Rocky PTG."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"Data model impact"}],"source_content_type":"text/x-rst","patch_set":2,"id":"bf659307_1cd03950","line":61,"range":{"start_line":61,"start_character":5,"end_line":61,"end_character":41},"updated":"2018-03-27 21:22:47.000000000","message":"would address the main race condition that people are actually worried about, but not all of them,\n\n(not actually seriously suggesting a change)","commit_id":"29202fa74ba0dd26352793d8b8ecffbc21666a27"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6b0305b6696b0caa242a6d2c16bc1a6f7e9ea3f3","unresolved":false,"context_lines":[{"line_number":121,"context_line":"  The PUT and DELETE methods will be changed to require consumer generation,"},{"line_number":122,"context_line":"  and will return a 409 Conflict if the supplied generation does not match the"},{"line_number":123,"context_line":"  current value in the consumers table. Currently the consumer_uuid is obtained"},{"line_number":124,"context_line":"  from the requesti environ; with this change, consumer_generation will also be"},{"line_number":125,"context_line":"  required. If it is missing, a 400 Bad Request will be returned."},{"line_number":126,"context_line":"  "},{"line_number":127,"context_line":"* /allocations - The POST method accepts multiple allocations, and the schema"}],"source_content_type":"text/x-rst","patch_set":2,"id":"bf659307_1c459917","line":124,"range":{"start_line":124,"start_character":11,"end_line":124,"end_character":19},"updated":"2018-03-27 21:22:47.000000000","message":"?","commit_id":"29202fa74ba0dd26352793d8b8ecffbc21666a27"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5a66f6fbe82c8e340cacc1d7f39e16b45a53b3a9","unresolved":false,"context_lines":[{"line_number":121,"context_line":"  The PUT and DELETE methods will be changed to require consumer generation,"},{"line_number":122,"context_line":"  and will return a 409 Conflict if the supplied generation does not match the"},{"line_number":123,"context_line":"  current value in the consumers table. Currently the consumer_uuid is obtained"},{"line_number":124,"context_line":"  from the requesti environ; with this change, consumer_generation will also be"},{"line_number":125,"context_line":"  required. If it is missing, a 400 Bad Request will be returned."},{"line_number":126,"context_line":"  "},{"line_number":127,"context_line":"* /allocations - The POST method accepts multiple allocations, and the schema"}],"source_content_type":"text/x-rst","patch_set":2,"id":"bf659307_1c5b592e","line":124,"range":{"start_line":124,"start_character":11,"end_line":124,"end_character":19},"updated":"2018-03-27 21:20:56.000000000","message":"?","commit_id":"29202fa74ba0dd26352793d8b8ecffbc21666a27"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"7e48e718130516162c3682c1746770ef861dfae3","unresolved":false,"context_lines":[{"line_number":121,"context_line":"  The PUT and DELETE methods will be changed to require consumer generation,"},{"line_number":122,"context_line":"  and will return a 409 Conflict if the supplied generation does not match the"},{"line_number":123,"context_line":"  current value in the consumers table. Currently the consumer_uuid is obtained"},{"line_number":124,"context_line":"  from the requesti environ; with this change, consumer_generation will also be"},{"line_number":125,"context_line":"  required. If it is missing, a 400 Bad Request will be returned."},{"line_number":126,"context_line":"  "},{"line_number":127,"context_line":"* /allocations - The POST method accepts multiple allocations, and the schema"}],"source_content_type":"text/x-rst","patch_set":2,"id":"bf659307_5cd79124","line":124,"range":{"start_line":124,"start_character":11,"end_line":124,"end_character":19},"in_reply_to":"bf659307_1c459917","updated":"2018-04-02 21:58:23.000000000","message":"vim strikes again","commit_id":"29202fa74ba0dd26352793d8b8ecffbc21666a27"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5a66f6fbe82c8e340cacc1d7f39e16b45a53b3a9","unresolved":false,"context_lines":[{"line_number":123,"context_line":"  current value in the consumers table. Currently the consumer_uuid is obtained"},{"line_number":124,"context_line":"  from the requesti environ; with this change, consumer_generation will also be"},{"line_number":125,"context_line":"  required. If it is missing, a 400 Bad Request will be returned."},{"line_number":126,"context_line":"  "},{"line_number":127,"context_line":"* /allocations - The POST method accepts multiple allocations, and the schema"},{"line_number":128,"context_line":"  will be modified in a new version to add a required value for"},{"line_number":129,"context_line":"  \u0027consumer_generation\u0027 at the same level as \u0027project_id\u0027 and \u0027user_id\u0027:"}],"source_content_type":"text/x-rst","patch_set":2,"id":"bf659307_9c31a9ef","line":126,"range":{"start_line":126,"start_character":0,"end_line":126,"end_character":2},"updated":"2018-03-27 21:20:56.000000000","message":"gasp!","commit_id":"29202fa74ba0dd26352793d8b8ecffbc21666a27"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6b0305b6696b0caa242a6d2c16bc1a6f7e9ea3f3","unresolved":false,"context_lines":[{"line_number":123,"context_line":"  current value in the consumers table. Currently the consumer_uuid is obtained"},{"line_number":124,"context_line":"  from the requesti environ; with this change, consumer_generation will also be"},{"line_number":125,"context_line":"  required. If it is missing, a 400 Bad Request will be returned."},{"line_number":126,"context_line":"  "},{"line_number":127,"context_line":"* /allocations - The POST method accepts multiple allocations, and the schema"},{"line_number":128,"context_line":"  will be modified in a new version to add a required value for"},{"line_number":129,"context_line":"  \u0027consumer_generation\u0027 at the same level as \u0027project_id\u0027 and \u0027user_id\u0027:"}],"source_content_type":"text/x-rst","patch_set":2,"id":"bf659307_bc4b4d29","line":126,"updated":"2018-03-27 21:22:47.000000000","message":"my editor does this too","commit_id":"29202fa74ba0dd26352793d8b8ecffbc21666a27"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"7e48e718130516162c3682c1746770ef861dfae3","unresolved":false,"context_lines":[{"line_number":123,"context_line":"  current value in the consumers table. Currently the consumer_uuid is obtained"},{"line_number":124,"context_line":"  from the requesti environ; with this change, consumer_generation will also be"},{"line_number":125,"context_line":"  required. If it is missing, a 400 Bad Request will be returned."},{"line_number":126,"context_line":"  "},{"line_number":127,"context_line":"* /allocations - The POST method accepts multiple allocations, and the schema"},{"line_number":128,"context_line":"  will be modified in a new version to add a required value for"},{"line_number":129,"context_line":"  \u0027consumer_generation\u0027 at the same level as \u0027project_id\u0027 and \u0027user_id\u0027:"}],"source_content_type":"text/x-rst","patch_set":2,"id":"bf659307_bce7cd12","line":126,"range":{"start_line":126,"start_character":0,"end_line":126,"end_character":2},"in_reply_to":"bf659307_9c31a9ef","updated":"2018-04-02 21:58:23.000000000","message":"Done","commit_id":"29202fa74ba0dd26352793d8b8ecffbc21666a27"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3e3fc5bdca998cecdcf9abdbfdd0f6fc9b5d1186","unresolved":false,"context_lines":[{"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."},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"As this is an API change, a new microversion will be created. Any older service"},{"line_number":53,"context_line":"that does not support this new microversion will continue to work, but will be"}],"source_content_type":"text/x-rst","patch_set":4,"id":"bf659307_3c310ea4","line":50,"updated":"2018-04-02 20:48:29.000000000","message":"I didn\u0027t realize PUT and POST were returning 204.  We need to change them to return 200 + payload, so the consumer can read the new generation off of it without doing a separate GET.  May as well do that in the same microversion.","commit_id":"dccd3694f1d5a7971dc4525116dd7114ccc4a028"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"090a83eb74538c8f05f8aaebd44e5fe743250684","unresolved":false,"context_lines":[{"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."},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"As this is an API change, a new microversion will be created. Any older service"},{"line_number":53,"context_line":"that does not support this new microversion will continue to work, but will be"}],"source_content_type":"text/x-rst","patch_set":4,"id":"bf659307_53e06126","line":50,"in_reply_to":"bf659307_3c310ea4","updated":"2018-04-03 12:18:51.000000000","message":"I don\u0027t think we should do that. While it perhaps makes sense for resource providers, especially in the context of ProviderTrees, I\u0027m not so sure about allocations; it\u0027s not in keeping with the original intent. It may very well be that things have changed sufficiently to review that intent but it\u0027s important that we know it.\n\nThe intent was that allocations are fire and forget.\nNow we\u0027ve added the wrinkle that two different things might like to allocate for the same consumer, so we want to make sure the two different consumers can have a consistent view. The generation can do that.\n\nHowever, nowhere in that is the idea of one of those things keeping state on the consumer generation: there\u0027s no much value in it. The reason for having it because something else might have changed it, which case our state is going to be wrong and we\u0027ll need to do a GET anyway.\n\nSo may as well always GET.\n\nWe do _not_ want to encourage clients to be as complex as the nova (and maybe neutron)  implementation is. Returning bodies (that will often be wrong soon after) does that.","commit_id":"dccd3694f1d5a7971dc4525116dd7114ccc4a028"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"253a128d1a2834a29c02c7191b0b49d74fcab645","unresolved":false,"context_lines":[{"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."},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"As this is an API change, a new microversion will be created. Any older service"},{"line_number":53,"context_line":"that does not support this new microversion will continue to work, but will be"}],"source_content_type":"text/x-rst","patch_set":4,"id":"bf659307_ce85aa08","line":50,"in_reply_to":"bf659307_53e06126","updated":"2018-04-03 13:45:42.000000000","message":"OK, so POST /allocations was specifically added so that the allocations of multiple *consumers* could be changed at the same time, atomically. This was to support move operations where we needed to atomically remove either the source or destination allocations when confirming or reverting a resize/migration.\n\nI don\u0027t see a need to change the response from a 204 No Content. I only see a need to change the request payload (as is mentioned below) and add a new 409 Conflict error response for when there are consumer generation conflicts.\n\nFor the PUT /allocations/{consumer_uuid}, I also do not see a need to change the response to include a generation. The reason is because we can simply return a 409 Conflict when *any* caller issues a PUT /allocations/{consumer_uuid} and there are already allocations for that consumer.\n\nWhen issuing a PUT /allocations/{consumer_uuid} and receiving a 409 Conflict indicating allocations already exists for a consumer, that will indicate to the caller that it must do a GET /allocations/{consumer_uuid} to get the most recent consumer generation and allocation information, construct an updated set of allocations and instead use the POST /allocations endpoint for creating the allocations, not the PUT /allocations/{consumer_uuid} endpoint.","commit_id":"dccd3694f1d5a7971dc4525116dd7114ccc4a028"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8cc28ac996e36185bafdfb3df0b10ff390e0bf26","unresolved":false,"context_lines":[{"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."},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"As this is an API change, a new microversion will be created. Any older service"},{"line_number":53,"context_line":"that does not support this new microversion will continue to work, but will be"}],"source_content_type":"text/x-rst","patch_set":4,"id":"bf659307_efe2e99f","line":50,"in_reply_to":"bf659307_ce85aa08","updated":"2018-04-03 14:54:01.000000000","message":"Hangout resolution: We will continue to return 204. If a caller needs to know the current state of allocations for some reason, like maintaining a cache, they should do a GET and use that response.","commit_id":"dccd3694f1d5a7971dc4525116dd7114ccc4a028"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"70f24d73a4c34e83801e47f3b16b833bdf996d3f","unresolved":false,"context_lines":[{"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."},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"As this is an API change, a new microversion will be created. Any older service"},{"line_number":53,"context_line":"that does not support this new microversion will continue to work, but will be"}],"source_content_type":"text/x-rst","patch_set":4,"id":"bf659307_6cca67a1","line":50,"in_reply_to":"bf659307_ce85aa08","updated":"2018-04-03 13:53:40.000000000","message":"To level set, you\u0027re suggesting:\n\n- PUT exists solely for creating the first allocations against a consumer.\n- POST must be used to update.\n\nThe first thing could work, theoretically, though it\u0027s a substantial shift in thinking.\n\nProblem is, POST still needs to be able to be used to create (e.g. the migration use case when we\u0027re \"transferring\" the resources from the source instance to the \"migration\" consumer).  Whereupon we still need to address the question of \"what do you send for the generation when the consumer doesn\u0027t exist yet?\"","commit_id":"dccd3694f1d5a7971dc4525116dd7114ccc4a028"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ce3fcde482cfd0c52b52540c43c597353e1be306","unresolved":false,"context_lines":[{"line_number":64,"context_line":"Data model impact"},{"line_number":65,"context_line":"-----------------"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"A new integer ``generation`` column, defaulting to 0,  will be added to"},{"line_number":68,"context_line":"Placement\u0027s ``consumers`` table, and a corresponding migration will be created."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"REST API impact"}],"source_content_type":"text/x-rst","patch_set":4,"id":"bf659307_a1717946","line":67,"range":{"start_line":67,"start_character":37,"end_line":67,"end_character":52},"updated":"2018-04-02 20:25:58.000000000","message":"Is this still true in light of Jay\u0027s recent review of the impl?","commit_id":"dccd3694f1d5a7971dc4525116dd7114ccc4a028"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8cc28ac996e36185bafdfb3df0b10ff390e0bf26","unresolved":false,"context_lines":[{"line_number":64,"context_line":"Data model impact"},{"line_number":65,"context_line":"-----------------"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"A new integer ``generation`` column, defaulting to 0,  will be added to"},{"line_number":68,"context_line":"Placement\u0027s ``consumers`` table, and a corresponding migration will be created."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"REST API impact"}],"source_content_type":"text/x-rst","patch_set":4,"id":"bf659307_0f8cfdd4","line":67,"range":{"start_line":67,"start_character":37,"end_line":67,"end_character":52},"in_reply_to":"bf659307_a1717946","updated":"2018-04-03 14:54:01.000000000","message":"Yes. I was thinking we could default to some random integer to make it more opaque, but zero seems adequate.","commit_id":"dccd3694f1d5a7971dc4525116dd7114ccc4a028"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f9e69b9bf805b0ac83686d638a50aee1a18463d1","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    {\u0027resource_provider_generation\u0027: GENERATION,"},{"line_number":79,"context_line":"     \u0027allocations\u0027:"},{"line_number":80,"context_line":"       CONSUMER_ID_1: {"},{"line_number":81,"context_line":"           \u0027consumer_generation\u0027: CONSUMER1_GENERATION,"},{"line_number":82,"context_line":"           \u0027resources\u0027: {"},{"line_number":83,"context_line":"              \u0027DISK_GB\u0027: 4,"},{"line_number":84,"context_line":"              \u0027VCPU\u0027: 2"}],"source_content_type":"text/x-rst","patch_set":4,"id":"bf659307_1cce8ab3","line":81,"range":{"start_line":81,"start_character":12,"end_line":81,"end_character":31},"updated":"2018-04-02 20:41:40.000000000","message":"here is where it would make sense to say just \u0027generate\u0027, since we\u0027re in the context of a consumer.  That would be more or less symmetrical with what we do for resource providers.  But explicit is better IMO.","commit_id":"dccd3694f1d5a7971dc4525116dd7114ccc4a028"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"253a128d1a2834a29c02c7191b0b49d74fcab645","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        \u0027consumer_generation\u0027: CONSUMER_GENERATION"},{"line_number":119,"context_line":"    }"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"  The PUT and DELETE methods will be changed to require consumer generation,"},{"line_number":122,"context_line":"  and will return a 409 Conflict if the supplied generation does not match the"},{"line_number":123,"context_line":"  current value in the consumers table. Currently the consumer_uuid is obtained"},{"line_number":124,"context_line":"  from the request environ; with this change, consumer_generation will also be"},{"line_number":125,"context_line":"  required. If it is missing, a 400 Bad Request will be returned."},{"line_number":126,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"bf659307_4c10c34e","line":123,"range":{"start_line":121,"start_character":2,"end_line":123,"end_character":39},"updated":"2018-04-03 13:45:42.000000000","message":"As noted above, I don\u0027t believe the PUT method needs to be modified to support a new consumer_generation field. Rather, upon finding existing allocations for a consumer, PUT /allocations/{consumer_uuid} should simply return a 409 Conflict.\n\nFor the DELETE /allocations/{consumer_uuid}, yes, adding a required consumer_generation field will be necessary.","commit_id":"dccd3694f1d5a7971dc4525116dd7114ccc4a028"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8cc28ac996e36185bafdfb3df0b10ff390e0bf26","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        \u0027consumer_generation\u0027: CONSUMER_GENERATION"},{"line_number":119,"context_line":"    }"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"  The PUT and DELETE methods will be changed to require consumer generation,"},{"line_number":122,"context_line":"  and will return a 409 Conflict if the supplied generation does not match the"},{"line_number":123,"context_line":"  current value in the consumers table. Currently the consumer_uuid is obtained"},{"line_number":124,"context_line":"  from the request environ; with this change, consumer_generation will also be"},{"line_number":125,"context_line":"  required. If it is missing, a 400 Bad Request will be returned."},{"line_number":126,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"bf659307_5210584e","line":123,"range":{"start_line":121,"start_character":2,"end_line":123,"end_character":39},"in_reply_to":"bf659307_4c10c34e","updated":"2018-04-03 14:54:01.000000000","message":"Hangout resolution: We agreed that all calls using the new microversion shall include consumer_generation; without it, it would fail at the API layer for failing to match the updated JSON schema. The value of the consumer generation would be `None` in cases where the consumer generation was not known ahead of time, which would be the most likely case for a new allocation. If the consumer exists, the generation that is supplied must match the value in the database, or a 409 Conflict will be returned. The caller is then responsible for doing a GET to obtain the current state, which will include the consumer generation. It will then attempt another PUT, including the consumer generation obtained in the GET.","commit_id":"dccd3694f1d5a7971dc4525116dd7114ccc4a028"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ce3fcde482cfd0c52b52540c43c597353e1be306","unresolved":false,"context_lines":[{"line_number":122,"context_line":"  and will return a 409 Conflict if the supplied generation does not match the"},{"line_number":123,"context_line":"  current value in the consumers table. Currently the consumer_uuid is obtained"},{"line_number":124,"context_line":"  from the request environ; with this change, consumer_generation will also be"},{"line_number":125,"context_line":"  required. If it is missing, a 400 Bad Request will be returned."},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"* /allocations - The POST method accepts multiple allocations, and the schema"},{"line_number":128,"context_line":"  will be modified in a new version to add a required value for"}],"source_content_type":"text/x-rst","patch_set":4,"id":"bf659307_617fe1df","line":125,"updated":"2018-04-02 20:25:58.000000000","message":"As we discussed [1], need a note here about what is expected the first time.  Namely:\n\n- You have to specify None, which will translate to json null.  (It\u0027s still required, as stated previously - you can\u0027t leave it out.)\n- Thus the json schema will have to tolerate [int or null].\n- The special behavior of None is: If the consumer doesn\u0027t exist, this call is allowed to create it.  Otherwise, 409 (because None will not \"equal\" whatever integer the generation is set to).\n- This weirdness needs to be explicitly documented in the api-ref, because it\u0027s not obvious.\n\nAn illustrative example might be helpful.  Normally, like when I\u0027m doing something for a provider, in general I get to use a pattern like:\n\n result \u003d get_the_provider_thingy()\n ...\n payload \u003d { ...,\n             \"provider_generation\": result[\u0027provider_generation\u0027] }\n\nBut for consumers, I instead must do:\n\n result \u003d get_allocations()\n ...\n payload \u003d { ...,\n             \"consumer_generation\": result.get(\u0027consumer_generation\u0027, None) }\n\n[1] http://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2018-04-02.log.html#t2018-04-02T19:48:33","commit_id":"dccd3694f1d5a7971dc4525116dd7114ccc4a028"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8cc28ac996e36185bafdfb3df0b10ff390e0bf26","unresolved":false,"context_lines":[{"line_number":122,"context_line":"  and will return a 409 Conflict if the supplied generation does not match the"},{"line_number":123,"context_line":"  current value in the consumers table. Currently the consumer_uuid is obtained"},{"line_number":124,"context_line":"  from the request environ; with this change, consumer_generation will also be"},{"line_number":125,"context_line":"  required. If it is missing, a 400 Bad Request will be returned."},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"* /allocations - The POST method accepts multiple allocations, and the schema"},{"line_number":128,"context_line":"  will be modified in a new version to add a required value for"}],"source_content_type":"text/x-rst","patch_set":4,"id":"bf659307_523938d4","line":125,"in_reply_to":"bf659307_331b6d73","updated":"2018-04-03 14:54:01.000000000","message":"Hangout resolution: there isn\u0027t a need to GET the current allocations in the vast majority of cases, as specifying `None` as the consumer generation is acceptable. Only when handling a response of 409 Conflict will a GET be necessary.","commit_id":"dccd3694f1d5a7971dc4525116dd7114ccc4a028"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"090a83eb74538c8f05f8aaebd44e5fe743250684","unresolved":false,"context_lines":[{"line_number":122,"context_line":"  and will return a 409 Conflict if the supplied generation does not match the"},{"line_number":123,"context_line":"  current value in the consumers table. Currently the consumer_uuid is obtained"},{"line_number":124,"context_line":"  from the request environ; with this change, consumer_generation will also be"},{"line_number":125,"context_line":"  required. If it is missing, a 400 Bad Request will be returned."},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"* /allocations - The POST method accepts multiple allocations, and the schema"},{"line_number":128,"context_line":"  will be modified in a new version to add a required value for"}],"source_content_type":"text/x-rst","patch_set":4,"id":"bf659307_331b6d73","line":125,"in_reply_to":"bf659307_617fe1df","updated":"2018-04-03 12:18:51.000000000","message":"Meh, but yeah.","commit_id":"dccd3694f1d5a7971dc4525116dd7114ccc4a028"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"38beda24141500f5ef1d2b6ec44a24deb2914e0e","unresolved":false,"context_lines":[{"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."},{"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"}],"source_content_type":"text/x-rst","patch_set":5,"id":"bf659307_c7d436ec","line":51,"range":{"start_line":51,"start_character":51,"end_line":51,"end_character":59},"updated":"2018-04-09 15:36:37.000000000","message":"technically null, since it\u0027s json","commit_id":"fa6c45330c577b8b3aa5adb9cb3bc2fdbfc61009"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"38beda24141500f5ef1d2b6ec44a24deb2914e0e","unresolved":false,"context_lines":[{"line_number":60,"context_line":"When there is no existing consumer record:"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"* Old microversion: always succeeds, and new consumer record created. Since"},{"line_number":63,"context_line":"  there is the possibility that an old microversion that does not pass"},{"line_number":64,"context_line":"  project_id and user_id in the request, those columns in the consumers table"},{"line_number":65,"context_line":"  will be changed to allow null values. In that case, the consumer record will"},{"line_number":66,"context_line":"  contain the consumer ID and the generation, but the project_id and user_id"}],"source_content_type":"text/x-rst","patch_set":5,"id":"bf659307_872ddefe","line":63,"range":{"start_line":63,"start_character":52,"end_line":63,"end_character":56},"updated":"2018-04-09 15:36:37.000000000","message":"strike","commit_id":"fa6c45330c577b8b3aa5adb9cb3bc2fdbfc61009"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"c7a465fb29ad33dcfc766c5e5d6efaa0a7284f9b","unresolved":false,"context_lines":[{"line_number":60,"context_line":"When there is no existing consumer record:"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"* Old microversion: always succeeds, and new consumer record created. Since"},{"line_number":63,"context_line":"  there is the possibility that an old microversion that does not pass"},{"line_number":64,"context_line":"  project_id and user_id in the request, those columns in the consumers table"},{"line_number":65,"context_line":"  will be changed to allow null values. In that case, the consumer record will"},{"line_number":66,"context_line":"  contain the consumer ID and the generation, but the project_id and user_id"}],"source_content_type":"text/x-rst","patch_set":5,"id":"bf659307_0e2b0682","line":63,"range":{"start_line":63,"start_character":52,"end_line":63,"end_character":56},"in_reply_to":"bf659307_4b4fb033","updated":"2018-04-10 18:22:09.000000000","message":"Microversions don\u0027t _do_ things, so I think we\u0027re kinda in \"sounds best to the ears\" territory here, but whatever :D","commit_id":"fa6c45330c577b8b3aa5adb9cb3bc2fdbfc61009"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"b9ffb8918ba0dc5dc6d8acae473fc8ff22a7c019","unresolved":false,"context_lines":[{"line_number":60,"context_line":"When there is no existing consumer record:"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"* Old microversion: always succeeds, and new consumer record created. Since"},{"line_number":63,"context_line":"  there is the possibility that an old microversion that does not pass"},{"line_number":64,"context_line":"  project_id and user_id in the request, those columns in the consumers table"},{"line_number":65,"context_line":"  will be changed to allow null values. In that case, the consumer record will"},{"line_number":66,"context_line":"  contain the consumer ID and the generation, but the project_id and user_id"}],"source_content_type":"text/x-rst","patch_set":5,"id":"bf659307_4b4fb033","line":63,"range":{"start_line":63,"start_character":52,"end_line":63,"end_character":56},"in_reply_to":"bf659307_68439db0","updated":"2018-04-10 18:14:42.000000000","message":"Technically, Eric is correct, but one thing you don\u0027t need in a spec is confusing language. I\u0027ve cleaned it up a bit.","commit_id":"fa6c45330c577b8b3aa5adb9cb3bc2fdbfc61009"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"88a28048954f882d4d98aea06ddebaf8a39b5d2e","unresolved":false,"context_lines":[{"line_number":60,"context_line":"When there is no existing consumer record:"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"* Old microversion: always succeeds, and new consumer record created. Since"},{"line_number":63,"context_line":"  there is the possibility that an old microversion that does not pass"},{"line_number":64,"context_line":"  project_id and user_id in the request, those columns in the consumers table"},{"line_number":65,"context_line":"  will be changed to allow null values. In that case, the consumer record will"},{"line_number":66,"context_line":"  contain the consumer ID and the generation, but the project_id and user_id"}],"source_content_type":"text/x-rst","patch_set":5,"id":"bf659307_68439db0","line":63,"range":{"start_line":63,"start_character":52,"end_line":63,"end_character":56},"in_reply_to":"bf659307_872ddefe","updated":"2018-04-10 15:34:25.000000000","message":"No? This would be strange without it.\n\n \"an old microversion does not pass project_id...\"\n\ndoesn\u0027t sound as nice to me as with \"that\"","commit_id":"fa6c45330c577b8b3aa5adb9cb3bc2fdbfc61009"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"38beda24141500f5ef1d2b6ec44a24deb2914e0e","unresolved":false,"context_lines":[{"line_number":76,"context_line":""},{"line_number":77,"context_line":"When there is an existing consumer record:"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"* Old microversion: always succeeds, and new consumer record created. As above,"},{"line_number":80,"context_line":"  the new consumer record may contain NULL values for project_id and user_id."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"* New microversion, CG \u003d None: Fail. The caller beieves there is no existing"}],"source_content_type":"text/x-rst","patch_set":5,"id":"bf659307_a72022f9","line":79,"range":{"start_line":79,"start_character":37,"end_line":79,"end_character":68},"updated":"2018-04-09 15:36:37.000000000","message":"Is it, or is it amended?  In any case, the generation winds up incremented from its previous value.","commit_id":"fa6c45330c577b8b3aa5adb9cb3bc2fdbfc61009"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"88a28048954f882d4d98aea06ddebaf8a39b5d2e","unresolved":false,"context_lines":[{"line_number":76,"context_line":""},{"line_number":77,"context_line":"When there is an existing consumer record:"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"* Old microversion: always succeeds, and new consumer record created. As above,"},{"line_number":80,"context_line":"  the new consumer record may contain NULL values for project_id and user_id."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"* New microversion, CG \u003d None: Fail. The caller beieves there is no existing"}],"source_content_type":"text/x-rst","patch_set":5,"id":"bf659307_a8221500","line":79,"range":{"start_line":79,"start_character":37,"end_line":79,"end_character":68},"in_reply_to":"bf659307_a72022f9","updated":"2018-04-10 15:34:25.000000000","message":"Yeah, because of the next sentence.","commit_id":"fa6c45330c577b8b3aa5adb9cb3bc2fdbfc61009"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"b9ffb8918ba0dc5dc6d8acae473fc8ff22a7c019","unresolved":false,"context_lines":[{"line_number":76,"context_line":""},{"line_number":77,"context_line":"When there is an existing consumer record:"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"* Old microversion: always succeeds, and new consumer record created. As above,"},{"line_number":80,"context_line":"  the new consumer record may contain NULL values for project_id and user_id."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"* New microversion, CG \u003d None: Fail. The caller beieves there is no existing"}],"source_content_type":"text/x-rst","patch_set":5,"id":"bf659307_0b63f8b2","line":79,"range":{"start_line":79,"start_character":37,"end_line":79,"end_character":68},"in_reply_to":"bf659307_a8221500","updated":"2018-04-10 18:14:42.000000000","message":"Good point. If there is a consumer record, and we get an old microversion, the generation will be incremented, but no validation will be done.","commit_id":"fa6c45330c577b8b3aa5adb9cb3bc2fdbfc61009"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"88a28048954f882d4d98aea06ddebaf8a39b5d2e","unresolved":false,"context_lines":[{"line_number":77,"context_line":"When there is an existing consumer record:"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"* Old microversion: always succeeds, and new consumer record created. As above,"},{"line_number":80,"context_line":"  the new consumer record may contain NULL values for project_id and user_id."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"* New microversion, CG \u003d None: Fail. The caller beieves there is no existing"},{"line_number":83,"context_line":"  consumer, and so is not in sync."}],"source_content_type":"text/x-rst","patch_set":5,"id":"bf659307_4821f9fa","line":80,"updated":"2018-04-10 15:34:25.000000000","message":"Surely we wouldn\u0027t overwrite or create another consumer record with NULL values for these fields if an old microversion is used after a new one, right?","commit_id":"fa6c45330c577b8b3aa5adb9cb3bc2fdbfc61009"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"b9ffb8918ba0dc5dc6d8acae473fc8ff22a7c019","unresolved":false,"context_lines":[{"line_number":77,"context_line":"When there is an existing consumer record:"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"* Old microversion: always succeeds, and new consumer record created. As above,"},{"line_number":80,"context_line":"  the new consumer record may contain NULL values for project_id and user_id."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"* New microversion, CG \u003d None: Fail. The caller beieves there is no existing"},{"line_number":83,"context_line":"  consumer, and so is not in sync."}],"source_content_type":"text/x-rst","patch_set":5,"id":"bf659307_ab0e8ce2","line":80,"in_reply_to":"bf659307_4821f9fa","updated":"2018-04-10 18:14:42.000000000","message":"Done","commit_id":"fa6c45330c577b8b3aa5adb9cb3bc2fdbfc61009"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"38beda24141500f5ef1d2b6ec44a24deb2914e0e","unresolved":false,"context_lines":[{"line_number":86,"context_line":"  something else has modified the allocations for the consumer, and the caller"},{"line_number":87,"context_line":"  is not in sync."},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"* New microversion, CG \u003d \u003cmatches DB\u003e: Success."},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"Alternatives"}],"source_content_type":"text/x-rst","patch_set":5,"id":"bf659307_6778caf7","line":89,"updated":"2018-04-09 15:36:37.000000000","message":"Nice section ++","commit_id":"fa6c45330c577b8b3aa5adb9cb3bc2fdbfc61009"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"88a28048954f882d4d98aea06ddebaf8a39b5d2e","unresolved":false,"context_lines":[{"line_number":107,"context_line":"---------------"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"* /resource_providers/{uuid}/allocations - the GET method will be changed to"},{"line_number":111,"context_line":"  return the current generation value for the consumer. The returned JSON will"},{"line_number":112,"context_line":"  look like::"},{"line_number":113,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"bf659307_8894f145","line":110,"range":{"start_line":110,"start_character":66,"end_line":110,"end_character":73},"updated":"2018-04-10 15:34:25.000000000","message":"Is the new generation the only thing added or is this reformatted in some way to make room? Just showing me the new thing below doesn\u0027t help me understand (the full story of) how it\u0027s changing.\n\nWe\u0027ve previously had to rotate some of our schema from indexed-by-resource-class to (or from?) a list of resources, etc. I just want to know if the only thing changing about the samples below is adding the generation field.","commit_id":"fa6c45330c577b8b3aa5adb9cb3bc2fdbfc61009"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"b9ffb8918ba0dc5dc6d8acae473fc8ff22a7c019","unresolved":false,"context_lines":[{"line_number":107,"context_line":"---------------"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"* /resource_providers/{uuid}/allocations - the GET method will be changed to"},{"line_number":111,"context_line":"  return the current generation value for the consumer. The returned JSON will"},{"line_number":112,"context_line":"  look like::"},{"line_number":113,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"bf659307_0bd69828","line":110,"range":{"start_line":110,"start_character":66,"end_line":110,"end_character":73},"in_reply_to":"bf659307_8894f145","updated":"2018-04-10 18:14:42.000000000","message":"Added comments to the samples to show that they are simply added lines.","commit_id":"fa6c45330c577b8b3aa5adb9cb3bc2fdbfc61009"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"88a28048954f882d4d98aea06ddebaf8a39b5d2e","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":"Developers of services that interact with placement will have to modify their"},{"line_number":222,"context_line":"code for allocating to specify the new microversion. They will also have to add"},{"line_number":223,"context_line":"handler code in the event that an allocation attempt returns a conflict."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"Upgrade impact"},{"line_number":226,"context_line":"--------------"}],"source_content_type":"text/x-rst","patch_set":5,"id":"bf659307_28092594","line":223,"updated":"2018-04-10 15:34:25.000000000","message":"There\u0027s at least one schema change happening here too right? I\u0027m not sure how many since there aren\u0027t deltas listed above, but one change mentions schema changes, which I assume are more than just \"adding the field\".","commit_id":"fa6c45330c577b8b3aa5adb9cb3bc2fdbfc61009"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"c7a465fb29ad33dcfc766c5e5d6efaa0a7284f9b","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":"Developers of services that interact with placement will have to modify their"},{"line_number":222,"context_line":"code for allocating to specify the new microversion. They will also have to add"},{"line_number":223,"context_line":"handler code in the event that an allocation attempt returns a conflict."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"Upgrade impact"},{"line_number":226,"context_line":"--------------"}],"source_content_type":"text/x-rst","patch_set":5,"id":"bf659307_ce0bce21","line":223,"in_reply_to":"bf659307_0bc1b8e4","updated":"2018-04-10 18:22:09.000000000","message":"I meant the schema of the API request/responses has changed.","commit_id":"fa6c45330c577b8b3aa5adb9cb3bc2fdbfc61009"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"b9ffb8918ba0dc5dc6d8acae473fc8ff22a7c019","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":"Developers of services that interact with placement will have to modify their"},{"line_number":222,"context_line":"code for allocating to specify the new microversion. They will also have to add"},{"line_number":223,"context_line":"handler code in the event that an allocation attempt returns a conflict."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"Upgrade impact"},{"line_number":226,"context_line":"--------------"}],"source_content_type":"text/x-rst","patch_set":5,"id":"bf659307_0bc1b8e4","line":223,"in_reply_to":"bf659307_28092594","updated":"2018-04-10 18:14:42.000000000","message":"I\u0027m not sure what you mean. With the new microversion, they have to supply the \u0027consumer_generation\u0027 field, just like they now have to supply \u0027project_id\u0027 and \u0027user_id\u0027. I\u0027ll add some extra language, but I\u0027m not sure if this is what you are asking for.","commit_id":"fa6c45330c577b8b3aa5adb9cb3bc2fdbfc61009"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"c7a465fb29ad33dcfc766c5e5d6efaa0a7284f9b","unresolved":false,"context_lines":[{"line_number":121,"context_line":"    {\u0027resource_provider_generation\u0027: GENERATION,"},{"line_number":122,"context_line":"     \u0027allocations\u0027:"},{"line_number":123,"context_line":"       CONSUMER_ID_1: {"},{"line_number":124,"context_line":"           # This next line will be added to the response."},{"line_number":125,"context_line":"           \u0027consumer_generation\u0027: CONSUMER1_GENERATION,"},{"line_number":126,"context_line":"           \u0027resources\u0027: {"},{"line_number":127,"context_line":"              \u0027DISK_GB\u0027: 4,"}],"source_content_type":"text/x-rst","patch_set":6,"id":"bf659307_2e1cca68","line":124,"updated":"2018-04-10 18:22:09.000000000","message":"This is what I was looking for (well, better than what I was looking for). I wonder if we could try to standardize on a way to indicate the delta in API examples like this. Maybe end of line comments like:\n\n {\u0027foo\u0027: 1.\n  \u0027bar\u0027: 2, # ADDED\n }\n\nor something.","commit_id":"553f72a72117fa7b44c65e5fef577acc05ab3d41"}]}
