)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"34eefe8492e76f5b501d89afdb53e87ff3b58598","unresolved":false,"context_lines":[{"line_number":17,"context_line":"The fix is tested by gate-ceilometer-dsvm-tempest-plugin-postgresql-ubuntu-xenial job"},{"line_number":18,"context_line":"here: https://review.openstack.org/#/c/427668/"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: I6cc93ba0dd569d56696c9210d38dd2d77b4157c1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3a461143_2f2165b5","line":20,"updated":"2017-02-01 13:22:59.000000000","message":"please add a closes-bug: #1660959","commit_id":"f8afa35420887ada463b2786105b2e4894cc80d2"}],"nova/objects/resource_provider.py":[{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"1ac5fef2479a258c3ccfae8f379e7e6116721e78","unresolved":false,"context_lines":[{"line_number":644,"context_line":"        usage \u003d usage.where(_ALLOC_TBL.c.resource_class_id.in_("},{"line_number":645,"context_line":"            resources.keys()))"},{"line_number":646,"context_line":"        usage \u003d usage.group_by(_ALLOC_TBL.c.resource_provider_id,"},{"line_number":647,"context_line":"                               _ALLOC_TBL.c.consumer_id,"},{"line_number":648,"context_line":"                               _ALLOC_TBL.c.resource_class_id)"},{"line_number":649,"context_line":"        usage \u003d sa.alias(usage, name\u003d\u0027usage\u0027)"},{"line_number":650,"context_line":"        query \u003d query.outerjoin("}],"source_content_type":"text/x-python","patch_set":2,"id":"3a461143_6ff8cd4a","line":647,"updated":"2017-02-01 13:25:41.000000000","message":"Hmm, after a quick glance at the code my understanding is that we *do not* want to group by consumer_id, but want to get a \"total\" usage value per a RP instead, so you should really remove line #641 and leave group by as is.","commit_id":"f8afa35420887ada463b2786105b2e4894cc80d2"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ad8305ca24e2dbe4fe827feaa04a900141347cf2","unresolved":false,"context_lines":[{"line_number":644,"context_line":"        usage \u003d usage.where(_ALLOC_TBL.c.resource_class_id.in_("},{"line_number":645,"context_line":"            resources.keys()))"},{"line_number":646,"context_line":"        usage \u003d usage.group_by(_ALLOC_TBL.c.resource_provider_id,"},{"line_number":647,"context_line":"                               _ALLOC_TBL.c.consumer_id,"},{"line_number":648,"context_line":"                               _ALLOC_TBL.c.resource_class_id)"},{"line_number":649,"context_line":"        usage \u003d sa.alias(usage, name\u003d\u0027usage\u0027)"},{"line_number":650,"context_line":"        query \u003d query.outerjoin("}],"source_content_type":"text/x-python","patch_set":2,"id":"3a461143_f25bc0f4","line":647,"in_reply_to":"3a461143_6ff8cd4a","updated":"2017-02-01 13:32:37.000000000","message":"Yeah,I think you\u0027re right. The consumer_id isn\u0027t relevant in this context, which means the query has been doing (slightly) more than it needs to all along.","commit_id":"f8afa35420887ada463b2786105b2e4894cc80d2"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"55424b3ef63f86aeb258636ca174f01c3300b92b","unresolved":false,"context_lines":[{"line_number":606,"context_line":"        # ON rp.id \u003d inv.resource_provider_id"},{"line_number":607,"context_line":"        # LEFT JOIN ("},{"line_number":608,"context_line":"        #    SELECT resource_provider_id, resource_class_id,"},{"line_number":609,"context_line":"        #      SUM(used) AS used"},{"line_number":610,"context_line":"        #    FROM allocations"},{"line_number":611,"context_line":"        #    WHERE resource_class_id IN ($RESOURCE_CLASSES)"},{"line_number":612,"context_line":"        #    GROUP BY resource_provider_id, resource_class_id"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a461143_d2a96492","line":609,"updated":"2017-02-01 13:34:58.000000000","message":"since this line is no longer change, may as well turn it back into its original form to not cloud the diff","commit_id":"fec181ec736ddb87ed0f0b040f38b304cfacaa91"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"9100ff8e6998f52f66bc32a667f6ba6503915e64","unresolved":false,"context_lines":[{"line_number":666,"context_line":"            )"},{"line_number":667,"context_line":"            for (r_idx, amount) in resources.items()]"},{"line_number":668,"context_line":"        query \u003d query.filter(sa.or_(*where_clauses))"},{"line_number":669,"context_line":"        query \u003d query.group_by(_RP_TBL.c.id)"},{"line_number":670,"context_line":"        # NOTE(sbauza): Only RPs having all the asked resources can be provided"},{"line_number":671,"context_line":"        query \u003d query.having(sql.func.count("},{"line_number":672,"context_line":"            sa.distinct(_INV_TBL.c.resource_class_id)) \u003d\u003d len(resources))"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a461143_dbb25f06","line":669,"updated":"2017-02-01 14:46:34.000000000","message":"(note) my understanding is that this GROUP BY is needed for HAVING below to work and using of a unique column or a PK have the same effect for all RDBMS, but PK also makes postgresql happy","commit_id":"03eced19f5d6665724a4fa432401be742383f8cf"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"f72fdcdfc06994eee3ba8f626b420dcdef0ffe6c","unresolved":false,"context_lines":[{"line_number":666,"context_line":"            )"},{"line_number":667,"context_line":"            for (r_idx, amount) in resources.items()]"},{"line_number":668,"context_line":"        query \u003d query.filter(sa.or_(*where_clauses))"},{"line_number":669,"context_line":"        query \u003d query.group_by(_RP_TBL.c.id)"},{"line_number":670,"context_line":"        # NOTE(sbauza): Only RPs having all the asked resources can be provided"},{"line_number":671,"context_line":"        query \u003d query.having(sql.func.count("},{"line_number":672,"context_line":"            sa.distinct(_INV_TBL.c.resource_class_id)) \u003d\u003d len(resources))"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a461143_41220003","line":669,"in_reply_to":"3a461143_dbb25f06","updated":"2017-02-01 15:33:30.000000000","message":"You\u0027re right, I wanted to filter out the RPs not providing all the resources and only present a list of RPs.\n\nGrouping by the PK should work either way, this clause is only here for making sure I\u0027m grouping by an unique key.","commit_id":"03eced19f5d6665724a4fa432401be742383f8cf"}]}
