)]}'
{"placement/handlers/allocation.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f40f7ac3657f4d1fc87ed8d4aade6f5f062e00f1","unresolved":true,"context_lines":[{"line_number":460,"context_line":"        retry\u003dtenacity.retry_if_exception_type("},{"line_number":461,"context_line":"            exception.ResourceProviderConcurrentUpdateDetected),"},{"line_number":462,"context_line":"        reraise\u003dTrue,"},{"line_number":463,"context_line":"    )"},{"line_number":464,"context_line":"    @db_api.placement_context_manager.writer"},{"line_number":465,"context_line":"    def _update_consumers_and_create_allocations(ctx):"},{"line_number":466,"context_line":"        # Update consumer attributes if requested attributes are different."}],"source_content_type":"text/x-python","patch_set":3,"id":"81441a0f_605a7f7f","line":463,"updated":"2023-10-19 16:21:01.000000000","message":"I haven\u0027t thought deep into this yet but wanted to raise the point that we want to make sure that any database mutations are done within a single transaction, so that if one piece fails an update, the entire set of updates will be rolled back together. We want to avoid the potential for partial updates happening.\n\nOn the surface, I\u0027m concerned that this method of retry could split a set of database updates into separate transactions that could leave the state in a \"partially done\" state of something fails part of the way through.\n\nIn the bug report you mention an alternative approach of reading state in a separate transaction before proceeding. I think that would be preferred if the retries currently proposed here would be able to break an \"atomic\" update transaction into disparate pieces that could fail in a partial way.\n\nJust wanted to mention this to keep it in mind.","commit_id":"52765a4b6ccea66e20d482a29df75106fdccbbbc"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"091a3f41ac4ad9884011da228572b585effe603c","unresolved":true,"context_lines":[{"line_number":460,"context_line":"        retry\u003dtenacity.retry_if_exception_type("},{"line_number":461,"context_line":"            exception.ResourceProviderConcurrentUpdateDetected),"},{"line_number":462,"context_line":"        reraise\u003dTrue,"},{"line_number":463,"context_line":"    )"},{"line_number":464,"context_line":"    @db_api.placement_context_manager.writer"},{"line_number":465,"context_line":"    def _update_consumers_and_create_allocations(ctx):"},{"line_number":466,"context_line":"        # Update consumer attributes if requested attributes are different."}],"source_content_type":"text/x-python","patch_set":3,"id":"a323f805_773608db","line":463,"in_reply_to":"81441a0f_605a7f7f","updated":"2023-10-19 16:59:56.000000000","message":"@melwitt,\n\nyes, there\u0027s another approach, plz check https://review.opendev.org/c/openstack/placement/+/898808\n\nindeed much simpler, and works in my testing - but fails like half of functional tests :-( presumably due to sqlite being used instead of full mysql etc.","commit_id":"52765a4b6ccea66e20d482a29df75106fdccbbbc"}],"placement/tests/functional/test_allocation.py":[{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"0f6d9e58224c49d55874d16dc8886b41e3db5f79","unresolved":true,"context_lines":[{"line_number":165,"context_line":"            resp \u003d client.post(url, data\u003dalloc_data, headers\u003dself.headers)"},{"line_number":166,"context_line":"            self.assertEqual(204, resp.status_code)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    def test_reshape(self):"},{"line_number":169,"context_line":"        alloc_data \u003d jsonutils.dump_as_bytes({"},{"line_number":170,"context_line":"            \u0027allocations\u0027: {"},{"line_number":171,"context_line":"                uuids.consumer: {"}],"source_content_type":"text/x-python","patch_set":4,"id":"2d9fc326_5b8f8752","line":168,"range":{"start_line":168,"start_character":8,"end_line":168,"end_character":20},"updated":"2023-10-24 16:44:41.000000000","message":"somehow this test fails for now if I add the same fixture to simulate concurrent update happening...","commit_id":"8b16395a17637d2f445472f77c8e1c348a63102c"}]}
