)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"1de87234f8aa052768d03ec0af18dba16854062b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"425e1bd4_39af1133","updated":"2024-11-11 11:09:51.000000000","message":"Extra context for reviewers: this is a cleaned up version of https://review.opendev.org/c/openstack/placement/+/898808\n\nBefore this fix, we could generate consistent placement atomicity violations during scheduling.\n\nWe tested various other fixes under high concurrency loads and this fix seems to address our problems.\n\nWe also tried the fix from https://github.com/openstack-k8s-operators/placement-operator/commit/a5b0bf43b21f495db52eac58c44e52261744605c but it had no measurable effect in our scenario.","commit_id":"9409e46bc9e608712d97f6012978d04587c4c179"},{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"2c58ef369a295e9c6f10eb47589f27698d59afe7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"af3e2354_cffd7847","updated":"2025-09-22 17:26:01.000000000","message":"Note to reviewers: this needs to be updated to take into account the refactor in: Fix placement allocate while over-capacity | https://review.opendev.org/c/openstack/placement/+/945465","commit_id":"9409e46bc9e608712d97f6012978d04587c4c179"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"948fdae779ba8703fc206dc2c13939a6fae277be","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"c22cc7c2_e44224e3","updated":"2026-01-08 14:23:49.000000000","message":"Sounds like there\u0027s some additional work needed here now, @github@jangutter.com?","commit_id":"9409e46bc9e608712d97f6012978d04587c4c179"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"c4b1c84c3d9600934b393825ed2d26cbccc8cd0c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"f6ed1199_1145fa57","updated":"2025-02-27 13:15:24.000000000","message":"This looks sane","commit_id":"9409e46bc9e608712d97f6012978d04587c4c179"},{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"fc709402a5f8c8cdc3296a5c6b250f0f679e253d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"65215153_f36766c3","updated":"2026-01-08 14:44:28.000000000","message":"Yeah, will take a look at this with Rich soon. We can still trigger the issue without this fix - but as mentioned, since this path can be called both from inside and from outside a transaction, we\u0027ll need to cater for that.","commit_id":"9409e46bc9e608712d97f6012978d04587c4c179"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"1885d6a6631b1e5b7643f33e32497bb64b391e80","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"b605c10e_c094fd76","updated":"2024-11-26 04:22:44.000000000","message":"i think this change make sense bur i do not have enough context on the code too say its correct.","commit_id":"9409e46bc9e608712d97f6012978d04587c4c179"}],"placement/objects/allocation.py":[{"author":{"_account_id":38512,"name":"Karol Klimaszewski","display_name":"kklimaszewski","email":"kklimaszewski@cloudferro.com","username":"kklimaszewski"},"change_message_id":"e9286efcf36358f61dbae6a8b0f694152f587177","unresolved":true,"context_lines":[{"line_number":166,"context_line":"    # database transaction when we reach here. We want to get an"},{"line_number":167,"context_line":"    # up-to-date usage value in case a racing request has"},{"line_number":168,"context_line":"    # changed it after we began an outer transaction."},{"line_number":169,"context_line":"    with db_api.placement_context_manager.reader.independent.using(ctx):"},{"line_number":170,"context_line":"        records \u003d ctx.session.execute(sel).all()"},{"line_number":171,"context_line":"    # Create a map keyed by (rp_uuid, res_class) for the records in the DB"},{"line_number":172,"context_line":"    usage_map \u003d {}"}],"source_content_type":"text/x-python","patch_set":1,"id":"6c9b82ea_2ba0e0fe","line":169,"updated":"2025-12-10 10:39:24.000000000","message":"This can cause issues with /reshaper endpoint (since it also uses replace_all() \u003e _set_allocations() \u003e _check_capacity_exceeded() code path). If request to create new inventory and put allocations on it is sent to /reshaper then inventory created earlier in reshaper process (in placement.objects.reshaper.reshape()) is not visible to this query (since that inventory is created inside a transaction) and InvalidInventory is raised right below due to len(missing_provs) \u003e 0.","commit_id":"9409e46bc9e608712d97f6012978d04587c4c179"},{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"aa04e95fcc3bb28c7c3bea8cc3723d2fb21acd9c","unresolved":true,"context_lines":[{"line_number":166,"context_line":"    # database transaction when we reach here. We want to get an"},{"line_number":167,"context_line":"    # up-to-date usage value in case a racing request has"},{"line_number":168,"context_line":"    # changed it after we began an outer transaction."},{"line_number":169,"context_line":"    with db_api.placement_context_manager.reader.independent.using(ctx):"},{"line_number":170,"context_line":"        records \u003d ctx.session.execute(sel).all()"},{"line_number":171,"context_line":"    # Create a map keyed by (rp_uuid, res_class) for the records in the DB"},{"line_number":172,"context_line":"    usage_map \u003d {}"}],"source_content_type":"text/x-python","patch_set":1,"id":"d32b5dc5_e5282a6a","line":169,"in_reply_to":"6c9b82ea_2ba0e0fe","updated":"2025-12-10 11:06:27.000000000","message":"Is this because transactions cannot be nested?\n\nIn that case, would the fix need to change _check_capacity_exceeded to make with_transaction optional depending on the caller?","commit_id":"9409e46bc9e608712d97f6012978d04587c4c179"},{"author":{"_account_id":38512,"name":"Karol Klimaszewski","display_name":"kklimaszewski","email":"kklimaszewski@cloudferro.com","username":"kklimaszewski"},"change_message_id":"ae81f627812e9b84dbc7cf7fee474c4a2fec5046","unresolved":true,"context_lines":[{"line_number":166,"context_line":"    # database transaction when we reach here. We want to get an"},{"line_number":167,"context_line":"    # up-to-date usage value in case a racing request has"},{"line_number":168,"context_line":"    # changed it after we began an outer transaction."},{"line_number":169,"context_line":"    with db_api.placement_context_manager.reader.independent.using(ctx):"},{"line_number":170,"context_line":"        records \u003d ctx.session.execute(sel).all()"},{"line_number":171,"context_line":"    # Create a map keyed by (rp_uuid, res_class) for the records in the DB"},{"line_number":172,"context_line":"    usage_map \u003d {}"}],"source_content_type":"text/x-python","patch_set":1,"id":"8d7cd783_7a9f0380","line":169,"in_reply_to":"d32b5dc5_e5282a6a","updated":"2025-12-10 11:23:33.000000000","message":"The problem is that reader.independent is \"modifier to start transaction independent from any enclosing\" (https://opendev.org/openstack/oslo.db/src/commit/fc79b296fbaad07177ebb5a8a18896abe8976176/oslo_db/sqlalchemy/enginefacade.py#L1081). So since this select is run in entirely separate transaction, changes made in enclosing transation (one made by reshaper) are not taken into account.\n\nThe fix you suggest could potentially solve this issue.","commit_id":"9409e46bc9e608712d97f6012978d04587c4c179"},{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"0da67272dc46af48151e6dfed0be271edfa5deb6","unresolved":false,"context_lines":[{"line_number":167,"context_line":"    # up-to-date usage value in case a racing request has"},{"line_number":168,"context_line":"    # changed it after we began an outer transaction."},{"line_number":169,"context_line":"    with db_api.placement_context_manager.reader.independent.using(ctx):"},{"line_number":170,"context_line":"        records \u003d ctx.session.execute(sel).all()"},{"line_number":171,"context_line":"    # Create a map keyed by (rp_uuid, res_class) for the records in the DB"},{"line_number":172,"context_line":"    usage_map \u003d {}"},{"line_number":173,"context_line":"    provs_with_inv \u003d set()"}],"source_content_type":"text/x-python","patch_set":1,"id":"990c1449_4e4f3ee3","line":170,"updated":"2024-11-11 12:13:46.000000000","message":"note to self: .all() here is equivalent to .fetchall()","commit_id":"9409e46bc9e608712d97f6012978d04587c4c179"}]}
