)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"05bb2cc6b432000f3999e43496cccdade3cbb094","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"217eb260_4e19e425","updated":"2024-08-21 16:06:27.000000000","message":"recheck","commit_id":"936f53ee84264ae5947c97ef0606db2e33020376"},{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"4a80cbebd86bfd87bf0a9ed399650515ef9d3ac6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"1a501961_018ae30d","updated":"2024-10-07 12:48:56.000000000","message":"recheck","commit_id":"4ecb80429f802ecbbeb0ca25f061597bc4d63b9c"}],"placement/objects/allocation.py":[{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"dd43a8cee1ea14cb52bc2a173b6cca5f6a5c5e48","unresolved":true,"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":3,"id":"71089a2a_ae64bb6e","line":170,"range":{"start_line":170,"start_character":43,"end_line":170,"end_character":48},"updated":"2024-10-04 16:52:02.000000000","message":"I have no idea how and why I accidentally added .all() here....","commit_id":"936f53ee84264ae5947c97ef0606db2e33020376"},{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"e1662e8ab54a1055280fc4dba791260d922fee88","unresolved":true,"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":3,"id":"0e5944da_b2452a0f","line":170,"range":{"start_line":170,"start_character":30,"end_line":170,"end_character":37},"updated":"2024-08-21 14:22:12.000000000","message":"at this stage we\u0027re inside a _writer_ transaction, but not a _reader_ transaction.","commit_id":"936f53ee84264ae5947c97ef0606db2e33020376"},{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"dab074474909f17de60bbea06c6694da1547c91a","unresolved":true,"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":3,"id":"9212eec2_b67921a5","line":170,"range":{"start_line":170,"start_character":43,"end_line":170,"end_character":48},"in_reply_to":"08885ffd_561f43df","updated":"2024-10-07 11:21:41.000000000","message":"Best I can tell is that this is the equivalent of fetchall(). I don\u0027t know how the locking interacts with the iterator returned by the query, but doing a fetchall inside the transaction \"seems\" reasonable.","commit_id":"936f53ee84264ae5947c97ef0606db2e33020376"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"f54c3920d7d069afbdd785808757d7138549f0bb","unresolved":true,"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":3,"id":"08885ffd_561f43df","line":170,"range":{"start_line":170,"start_character":43,"end_line":170,"end_character":48},"in_reply_to":"71089a2a_ae64bb6e","updated":"2024-10-07 10:44:44.000000000","message":"I kind of suspect this has something to do with sqlite vs proper sql in unit or functional tests, try running the test w/o it.","commit_id":"936f53ee84264ae5947c97ef0606db2e33020376"},{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"e1662e8ab54a1055280fc4dba791260d922fee88","unresolved":true,"context_lines":[{"line_number":249,"context_line":"    return res_providers"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"@db_api.placement_context_manager.reader"},{"line_number":253,"context_line":"def _get_allocations_by_provider_id(ctx, rp_id):"},{"line_number":254,"context_line":"    allocs \u003d sa.alias(_ALLOC_TBL, name\u003d\"a\")"},{"line_number":255,"context_line":"    consumers \u003d sa.alias(_CONSUMER_TBL, name\u003d\"c\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"f862f88c_e4fefab7","line":252,"range":{"start_line":252,"start_character":0,"end_line":252,"end_character":40},"updated":"2024-08-21 14:22:12.000000000","message":"note that these are wrapped here, in contrast to the reader in _check_capacity_exceeded","commit_id":"936f53ee84264ae5947c97ef0606db2e33020376"},{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"e1662e8ab54a1055280fc4dba791260d922fee88","unresolved":true,"context_lines":[{"line_number":326,"context_line":""},{"line_number":327,"context_line":"@oslo_db_api.wrap_db_retry(max_retries\u003d5, retry_on_deadlock\u003dTrue)"},{"line_number":328,"context_line":"@db_api.placement_context_manager.writer"},{"line_number":329,"context_line":"def _set_allocations(context, allocs):"},{"line_number":330,"context_line":"    \"\"\"Write a set of allocations."},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"    We must check that there is capacity for each allocation."}],"source_content_type":"text/x-python","patch_set":3,"id":"bc3e495a_6f7b2f44","line":329,"range":{"start_line":329,"start_character":0,"end_line":329,"end_character":38},"updated":"2024-08-21 14:22:12.000000000","message":"this is the only function that calls _check_capacity_exceeded. It also calls a number of other functions that do queries, but they all take a _reader_ transaction. _check_capacity_exceeded does not in the unmodified code.","commit_id":"936f53ee84264ae5947c97ef0606db2e33020376"},{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"e1662e8ab54a1055280fc4dba791260d922fee88","unresolved":true,"context_lines":[{"line_number":528,"context_line":"                # the first time we are reading the resource provider records"},{"line_number":529,"context_line":"                # during our transaction."},{"line_number":530,"context_line":"                db_context_manager \u003d db_api.placement_context_manager"},{"line_number":531,"context_line":"                with db_context_manager.reader.independent.using(context):"},{"line_number":532,"context_line":"                    seen_rps[rp_uuid] \u003d rp_obj.ResourceProvider.get_by_uuid("},{"line_number":533,"context_line":"                        context, rp_uuid)"},{"line_number":534,"context_line":"            for alloc in alloc_list:"}],"source_content_type":"text/x-python","patch_set":3,"id":"0fe508a1_86e8be72","line":531,"range":{"start_line":531,"start_character":16,"end_line":531,"end_character":74},"updated":"2024-08-21 14:22:12.000000000","message":"and here\u0027s the wrapper for the replace_all","commit_id":"936f53ee84264ae5947c97ef0606db2e33020376"}]}
