)]}'
{"nova/api/openstack/placement/objects/consumer.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2765ec02a25a19c93cc2728ce6c2e2b259d008e1","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"@db_api.placement_context_manager.writer"},{"line_number":29,"context_line":"def create_incomplete_consumers(ctx, batch_size):"},{"line_number":30,"context_line":"    \"\"\"Finds all the consumer records that are missing for allocations and"},{"line_number":31,"context_line":"    creates consumer records for them, using the \"incomplete consumer\" project"},{"line_number":32,"context_line":"    and user CONF options."}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_5137e8fd","line":29,"range":{"start_line":29,"start_character":4,"end_line":29,"end_character":31},"updated":"2018-10-16 18:50:32.000000000","message":"Don\u0027t we have the same issue in here?","commit_id":"76b5d1ea987b1d801be557280077cfe65c558564"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"3a5eaf64af29c5aaf1127f94d779282fd4667fde","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    sel \u003d sa.select(cols)"},{"line_number":56,"context_line":"    sel \u003d sel.select_from(alloc_to_consumer)"},{"line_number":57,"context_line":"    sel \u003d sel.where(CONSUMER_TBL.c.id.is_(None))"},{"line_number":58,"context_line":"    # NOTE(mnaser): It is possible to have multiple consumers having many"},{"line_number":59,"context_line":"    #               allocations to the same resource provider, which would"},{"line_number":60,"context_line":"    #               make the INSERT FROM SELECT fail due to duplicates."},{"line_number":61,"context_line":"    sel \u003d sel.group_by(_ALLOC_TBL.c.consumer_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_29a444b7","line":58,"updated":"2018-10-16 20:23:11.000000000","message":"nit: no real need to be a NOTE, a straight comment ought to suffice","commit_id":"730936e535e67127c76d4f27649a16d8cf05efc9"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"27451e193e4b4215b16a7e21e1edb41adeeb1363","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    # NOTE(mnaser): It is possible to have multiple consumers having many"},{"line_number":59,"context_line":"    #               allocations to the same resource provider, which would"},{"line_number":60,"context_line":"    #               make the INSERT FROM SELECT fail due to duplicates."},{"line_number":61,"context_line":"    sel \u003d sel.group_by(_ALLOC_TBL.c.consumer_id)"},{"line_number":62,"context_line":"    sel \u003d sel.limit(batch_size)"},{"line_number":63,"context_line":"    target_cols \u003d [\u0027uuid\u0027, \u0027project_id\u0027, \u0027user_id\u0027]"},{"line_number":64,"context_line":"    ins_stmt \u003d CONSUMER_TBL.insert().from_select(target_cols, sel)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_8d1bebc9","line":61,"updated":"2018-10-18 21:25:51.000000000","message":"Not certain, but this group by might tickle the error that can happen in postgresql because of its preference for columns in the group by to appear in the selected columns.\n\nLeaving this as a note for future reference. If nobody has thoughts before then, I\u0027ll look more closely on Monday","commit_id":"730936e535e67127c76d4f27649a16d8cf05efc9"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"22171735b992a7ebfbd818d879f474e891379377","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    # NOTE(mnaser): It is possible to have multiple consumers having many"},{"line_number":59,"context_line":"    #               allocations to the same resource provider, which would"},{"line_number":60,"context_line":"    #               make the INSERT FROM SELECT fail due to duplicates."},{"line_number":61,"context_line":"    sel \u003d sel.group_by(_ALLOC_TBL.c.consumer_id)"},{"line_number":62,"context_line":"    sel \u003d sel.limit(batch_size)"},{"line_number":63,"context_line":"    target_cols \u003d [\u0027uuid\u0027, \u0027project_id\u0027, \u0027user_id\u0027]"},{"line_number":64,"context_line":"    ins_stmt \u003d CONSUMER_TBL.insert().from_select(target_cols, sel)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_6002db0e","line":61,"in_reply_to":"3f79a3b5_8d1bebc9","updated":"2018-10-22 20:20:45.000000000","message":"Okay, this appears to not be a problem because of the three columns in the select, two are static values, not columns identifiers. Postgresql appears to be cool with that (it would have to be as you couldn\u0027t group...)","commit_id":"730936e535e67127c76d4f27649a16d8cf05efc9"}],"nova/api/openstack/placement/objects/resource_provider.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"eb820b423e96bf67904111b8cfbc3fd0b66455be","unresolved":false,"context_lines":[{"line_number":1957,"context_line":"        # NOTE(mnaser): It is possible to have multiple consumers having many"},{"line_number":1958,"context_line":"        #               allocations to the same resource provider, which would"},{"line_number":1959,"context_line":"        #               make the INSERT FROM SELECT fail due to duplicates."},{"line_number":1960,"context_line":"        sel \u003d sel.group_by(_ALLOC_TBL.c.consumer_id)"},{"line_number":1961,"context_line":"        target_cols \u003d [\u0027uuid\u0027, \u0027project_id\u0027, \u0027user_id\u0027]"},{"line_number":1962,"context_line":"        ins_stmt \u003d consumer_obj.CONSUMER_TBL.insert().from_select("},{"line_number":1963,"context_line":"            target_cols, sel)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_5c1e1f5e","line":1960,"updated":"2018-10-16 18:53:34.000000000","message":"The online data migration code runs through something else, unfortunately, and it looks like that will suffer from the same issue:\n\nhttps://review.openstack.org/#/c/611115/3/nova/api/openstack/placement/objects/consumer.py@29\n\nI\u0027m just not sure how we didn\u0027t hit that in grenade in rocky...","commit_id":"76b5d1ea987b1d801be557280077cfe65c558564"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e7c58c4af0d5d63c5e662264c33708c0ad57080e","unresolved":false,"context_lines":[{"line_number":1970,"context_line":""},{"line_number":1971,"context_line":""},{"line_number":1972,"context_line":"@db_api.placement_context_manager.writer.independent"},{"line_number":1973,"context_line":"def _create_incomplete_consumer(ctx, consumer_id):"},{"line_number":1974,"context_line":"    # TODO(jaypipes): Remove in Stein after a blocker migration is added."},{"line_number":1975,"context_line":"    \"\"\"Creates consumer record if consumer relationship between allocations -\u003e"},{"line_number":1976,"context_line":"    consumers table is missing for the supplied consumer UUID, using the"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_1c066722","line":1973,"range":{"start_line":1973,"start_character":4,"end_line":1973,"end_character":31},"updated":"2018-10-16 19:24:52.000000000","message":"Is this also busted?","commit_id":"76b5d1ea987b1d801be557280077cfe65c558564"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9653be95f764c1ecd3c7341388765a79bc9062e4","unresolved":false,"context_lines":[{"line_number":1970,"context_line":""},{"line_number":1971,"context_line":""},{"line_number":1972,"context_line":"@db_api.placement_context_manager.writer.independent"},{"line_number":1973,"context_line":"def _create_incomplete_consumer(ctx, consumer_id):"},{"line_number":1974,"context_line":"    # TODO(jaypipes): Remove in Stein after a blocker migration is added."},{"line_number":1975,"context_line":"    \"\"\"Creates consumer record if consumer relationship between allocations -\u003e"},{"line_number":1976,"context_line":"    consumers table is missing for the supplied consumer UUID, using the"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_5705980d","line":1973,"range":{"start_line":1973,"start_character":4,"end_line":1973,"end_character":31},"in_reply_to":"3f79a3b5_1c066722","updated":"2018-10-16 19:25:49.000000000","message":"I don\u0027t think so since it\u0027s not doing an insert-from-select like the other places.","commit_id":"76b5d1ea987b1d801be557280077cfe65c558564"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"3a5eaf64af29c5aaf1127f94d779282fd4667fde","unresolved":false,"context_lines":[{"line_number":1954,"context_line":"            sa.and_("},{"line_number":1955,"context_line":"                _ALLOC_TBL.c.resource_provider_id \u003d\u003d rp_id,"},{"line_number":1956,"context_line":"                consumer_obj.CONSUMER_TBL.c.id.is_(None)))"},{"line_number":1957,"context_line":"        # NOTE(mnaser): It is possible to have multiple consumers having many"},{"line_number":1958,"context_line":"        #               allocations to the same resource provider, which would"},{"line_number":1959,"context_line":"        #               make the INSERT FROM SELECT fail due to duplicates."},{"line_number":1960,"context_line":"        sel \u003d sel.group_by(_ALLOC_TBL.c.consumer_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_699ebc69","line":1957,"updated":"2018-10-16 20:23:11.000000000","message":"nit: this doesn\u0027t need to be a NOTE, it can just be a comment","commit_id":"730936e535e67127c76d4f27649a16d8cf05efc9"}]}
