)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"3a5c109bb67e4c4052167eccbb24dfd3ada427a5","unresolved":false,"context_lines":[{"line_number":23,"context_line":"[efried: Not sure I agree that we need separate test cases; rather,"},{"line_number":24,"context_line":"having many possible permutations of RPs in various states of inventory"},{"line_number":25,"context_line":"provided \u0026 consumed, trying to hit all parts of the SQL.  Take a look at"},{"line_number":26,"context_line":"the new version of test_get_providers_with_any_resource.]"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Partial-implement-blueprint add-trait-support-in-allocation-candidates"},{"line_number":29,"context_line":"Change-Id: I37dcfbee8524c067720f626fecbc30484f4774ba"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3f4b6375_4658802f","line":26,"updated":"2017-10-27 06:54:16.000000000","message":"The separate test cases is more clear on what we test, but I like the way you used about using \u0027inc_\u0027 and \u0027exc_\u0027 prefix for rp name.","commit_id":"414ac87dc158935cec278148c0fd1ee405c9e77c"}],"nova/objects/resource_provider.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dca036cb0f079c9c8b2aa78d3faca4f12a02c699","unresolved":false,"context_lines":[{"line_number":798,"context_line":"def _get_providers_with_any_resource(ctx, resources):"},{"line_number":799,"context_line":"    \"\"\"This method returns a set of resource providers which have any requested"},{"line_number":800,"context_line":"    resource as a dict, the key is the resource provider id, the value is a"},{"line_number":801,"context_line":"    list of resources are matched the request."},{"line_number":802,"context_line":"    \"\"\""},{"line_number":803,"context_line":"    # The SQL is as below:"},{"line_number":804,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f4b6375_6fc4d35f","line":801,"range":{"start_line":801,"start_character":22,"end_line":801,"end_character":33},"updated":"2017-10-24 10:42:42.000000000","message":"s/are matched/that match","commit_id":"afcdea19cfcaaf870f430fe9b5e420164c01017f"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dca036cb0f079c9c8b2aa78d3faca4f12a02c699","unresolved":false,"context_lines":[{"line_number":806,"context_line":"    # FROM resource_providers as rp"},{"line_number":807,"context_line":"    # JOIN investories as inv"},{"line_number":808,"context_line":"    # ON rp.id \u003d\u003d inv.resource_provider_id OR"},{"line_number":809,"context_line":"    #     inv.resource_class_id in $REQUESTED_RESOURCE_CLASS_ID"},{"line_number":810,"context_line":"    # LEFT JOIN ("},{"line_number":811,"context_line":"    #     SELECT allocations.resource_provider_id,"},{"line_number":812,"context_line":"    #         allocations.resource_class_id, SUM(allocations.used)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f4b6375_2f325b60","line":809,"range":{"start_line":809,"start_character":32,"end_line":809,"end_character":34},"updated":"2017-10-24 10:42:42.000000000","message":"please capitalize IN since it\u0027s a SQL keyword.","commit_id":"afcdea19cfcaaf870f430fe9b5e420164c01017f"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dca036cb0f079c9c8b2aa78d3faca4f12a02c699","unresolved":false,"context_lines":[{"line_number":896,"context_line":"    sel \u003d sel.select_from(join_chain)"},{"line_number":897,"context_line":"    sel \u003d sel.where(sa.or_(*usage_cond))"},{"line_number":898,"context_line":""},{"line_number":899,"context_line":"    to_return \u003d collections.defaultdict(list)"},{"line_number":900,"context_line":"    for r in ctx.session.execute(sel):"},{"line_number":901,"context_line":"        to_return[r[0]].append([r[1], r[2], r[3]])"},{"line_number":902,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f4b6375_aff88b7a","line":899,"range":{"start_line":899,"start_character":40,"end_line":899,"end_character":44},"updated":"2017-10-24 10:42:42.000000000","message":"instead of returning a list of fields, consider making a namedtuple and returning a dict of namedtuples so that fields can be referred to by name.\n\nSee here for an example of doing this:\n\nhttps://review.openstack.org/#/c/377138/53/nova/objects/resource_provider.py\n\nlines 521 and 565","commit_id":"afcdea19cfcaaf870f430fe9b5e420164c01017f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e8ea6851d18543d37c78b73ff52088bd6d83c8c1","unresolved":false,"context_lines":[{"line_number":795,"context_line":""},{"line_number":796,"context_line":""},{"line_number":797,"context_line":"@db_api.api_context_manager.reader"},{"line_number":798,"context_line":"def _get_provider_ids_with_any_resource(ctx, resources):"},{"line_number":799,"context_line":"    \"\"\"This method returns a list of resource provider ids, each resource"},{"line_number":800,"context_line":"    provider has any enough resource in the `resources`."},{"line_number":801,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_788a4d6a","line":798,"range":{"start_line":798,"start_character":45,"end_line":798,"end_character":54},"updated":"2017-10-24 17:29:35.000000000","message":"Worth documenting that this is a dict of RC IDs (not names) to integer counts.\n\nWhy is it RC IDs rather than names?  Guess I\u0027ll see later based on how you\u0027re using it.","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e8ea6851d18543d37c78b73ff52088bd6d83c8c1","unresolved":false,"context_lines":[{"line_number":797,"context_line":"@db_api.api_context_manager.reader"},{"line_number":798,"context_line":"def _get_provider_ids_with_any_resource(ctx, resources):"},{"line_number":799,"context_line":"    \"\"\"This method returns a list of resource provider ids, each resource"},{"line_number":800,"context_line":"    provider has any enough resource in the `resources`."},{"line_number":801,"context_line":"    \"\"\""},{"line_number":802,"context_line":""},{"line_number":803,"context_line":"    # The SQL is as below:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_fc119405","line":800,"range":{"start_line":800,"start_character":13,"end_line":800,"end_character":43},"updated":"2017-10-24 17:29:35.000000000","message":"How about \"satisfies one or more of the specified resources\"","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"ddb0b310d54cd3ed3db8c9d6b75c4bf3ba03d9bc","unresolved":false,"context_lines":[{"line_number":797,"context_line":"@db_api.api_context_manager.reader"},{"line_number":798,"context_line":"def _get_provider_ids_with_any_resource(ctx, resources):"},{"line_number":799,"context_line":"    \"\"\"This method returns a list of resource provider ids, each resource"},{"line_number":800,"context_line":"    provider has any enough resource in the `resources`."},{"line_number":801,"context_line":"    \"\"\""},{"line_number":802,"context_line":""},{"line_number":803,"context_line":"    # The SQL is as below:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_789c82bf","line":800,"range":{"start_line":800,"start_character":13,"end_line":800,"end_character":43},"in_reply_to":"3f4b6375_fc119405","updated":"2017-10-25 08:41:56.000000000","message":"yea, thanks, that is better","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e8ea6851d18543d37c78b73ff52088bd6d83c8c1","unresolved":false,"context_lines":[{"line_number":802,"context_line":""},{"line_number":803,"context_line":"    # The SQL is as below:"},{"line_number":804,"context_line":"    #"},{"line_number":805,"context_line":"    # SELECT rp.id"},{"line_number":806,"context_line":"    # FROM resource_providers as rp"},{"line_number":807,"context_line":"    # JOIN investories as inv"},{"line_number":808,"context_line":"    # ON rp.id \u003d\u003d inv.resource_provider_id OR"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_77293d99","line":805,"range":{"start_line":805,"start_character":6,"end_line":805,"end_character":18},"updated":"2017-10-24 17:29:35.000000000","message":"More efficient to use DISTINCT here (and then you don\u0027t need to do set() on L899).","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"ddb0b310d54cd3ed3db8c9d6b75c4bf3ba03d9bc","unresolved":false,"context_lines":[{"line_number":802,"context_line":""},{"line_number":803,"context_line":"    # The SQL is as below:"},{"line_number":804,"context_line":"    #"},{"line_number":805,"context_line":"    # SELECT rp.id"},{"line_number":806,"context_line":"    # FROM resource_providers as rp"},{"line_number":807,"context_line":"    # JOIN investories as inv"},{"line_number":808,"context_line":"    # ON rp.id \u003d\u003d inv.resource_provider_id OR"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_1029de99","line":805,"range":{"start_line":805,"start_character":6,"end_line":805,"end_character":18},"in_reply_to":"3f4b6375_77293d99","updated":"2017-10-25 08:41:56.000000000","message":"Yea, good point","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e8ea6851d18543d37c78b73ff52088bd6d83c8c1","unresolved":false,"context_lines":[{"line_number":803,"context_line":"    # The SQL is as below:"},{"line_number":804,"context_line":"    #"},{"line_number":805,"context_line":"    # SELECT rp.id"},{"line_number":806,"context_line":"    # FROM resource_providers as rp"},{"line_number":807,"context_line":"    # JOIN investories as inv"},{"line_number":808,"context_line":"    # ON rp.id \u003d\u003d inv.resource_provider_id OR"},{"line_number":809,"context_line":"    #     inv.resource_class_id in $REQUESTED_RESOURCE_CLASS_ID"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_17b6898b","line":806,"range":{"start_line":806,"start_character":30,"end_line":806,"end_character":32},"updated":"2017-10-24 17:29:35.000000000","message":"AS","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e8ea6851d18543d37c78b73ff52088bd6d83c8c1","unresolved":false,"context_lines":[{"line_number":804,"context_line":"    #"},{"line_number":805,"context_line":"    # SELECT rp.id"},{"line_number":806,"context_line":"    # FROM resource_providers as rp"},{"line_number":807,"context_line":"    # JOIN investories as inv"},{"line_number":808,"context_line":"    # ON rp.id \u003d\u003d inv.resource_provider_id OR"},{"line_number":809,"context_line":"    #     inv.resource_class_id in $REQUESTED_RESOURCE_CLASS_ID"},{"line_number":810,"context_line":"    # LEFT JOIN ("}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_d7b35197","line":807,"range":{"start_line":807,"start_character":11,"end_line":807,"end_character":25},"updated":"2017-10-24 17:29:35.000000000","message":"inventories AS","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e8ea6851d18543d37c78b73ff52088bd6d83c8c1","unresolved":false,"context_lines":[{"line_number":805,"context_line":"    # SELECT rp.id"},{"line_number":806,"context_line":"    # FROM resource_providers as rp"},{"line_number":807,"context_line":"    # JOIN investories as inv"},{"line_number":808,"context_line":"    # ON rp.id \u003d\u003d inv.resource_provider_id OR"},{"line_number":809,"context_line":"    #     inv.resource_class_id in $REQUESTED_RESOURCE_CLASS_ID"},{"line_number":810,"context_line":"    # LEFT JOIN ("},{"line_number":811,"context_line":"    #     SELECT allocations.resource_provider_id,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_9775d934","line":808,"range":{"start_line":808,"start_character":43,"end_line":808,"end_character":45},"updated":"2017-10-24 17:29:35.000000000","message":"AND","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e8ea6851d18543d37c78b73ff52088bd6d83c8c1","unresolved":false,"context_lines":[{"line_number":806,"context_line":"    # FROM resource_providers as rp"},{"line_number":807,"context_line":"    # JOIN investories as inv"},{"line_number":808,"context_line":"    # ON rp.id \u003d\u003d inv.resource_provider_id OR"},{"line_number":809,"context_line":"    #     inv.resource_class_id in $REQUESTED_RESOURCE_CLASS_ID"},{"line_number":810,"context_line":"    # LEFT JOIN ("},{"line_number":811,"context_line":"    #     SELECT allocations.resource_provider_id,"},{"line_number":812,"context_line":"    #         allocations.resource_class_id, SUM(allocations.used)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_5791a146","line":809,"range":{"start_line":809,"start_character":61,"end_line":809,"end_character":63},"updated":"2017-10-24 17:29:35.000000000","message":"IDS (it\u0027s a list)","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e8ea6851d18543d37c78b73ff52088bd6d83c8c1","unresolved":false,"context_lines":[{"line_number":806,"context_line":"    # FROM resource_providers as rp"},{"line_number":807,"context_line":"    # JOIN investories as inv"},{"line_number":808,"context_line":"    # ON rp.id \u003d\u003d inv.resource_provider_id OR"},{"line_number":809,"context_line":"    #     inv.resource_class_id in $REQUESTED_RESOURCE_CLASS_ID"},{"line_number":810,"context_line":"    # LEFT JOIN ("},{"line_number":811,"context_line":"    #     SELECT allocations.resource_provider_id,"},{"line_number":812,"context_line":"    #         allocations.resource_class_id, SUM(allocations.used)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_3824d5ae","line":809,"range":{"start_line":809,"start_character":32,"end_line":809,"end_character":34},"updated":"2017-10-24 17:29:35.000000000","message":"IN","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e8ea6851d18543d37c78b73ff52088bd6d83c8c1","unresolved":false,"context_lines":[{"line_number":809,"context_line":"    #     inv.resource_class_id in $REQUESTED_RESOURCE_CLASS_ID"},{"line_number":810,"context_line":"    # LEFT JOIN ("},{"line_number":811,"context_line":"    #     SELECT allocations.resource_provider_id,"},{"line_number":812,"context_line":"    #         allocations.resource_class_id, SUM(allocations.used)"},{"line_number":813,"context_line":"    #     FROM allocations"},{"line_number":814,"context_line":"    #     GROUP BY allocations.resource_provider_id,"},{"line_number":815,"context_line":"    #         allocation.resource_class_id"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_72026b0d","line":812,"range":{"start_line":812,"start_character":45,"end_line":812,"end_character":66},"updated":"2017-10-24 17:29:35.000000000","message":"AS used","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e8ea6851d18543d37c78b73ff52088bd6d83c8c1","unresolved":false,"context_lines":[{"line_number":812,"context_line":"    #         allocations.resource_class_id, SUM(allocations.used)"},{"line_number":813,"context_line":"    #     FROM allocations"},{"line_number":814,"context_line":"    #     GROUP BY allocations.resource_provider_id,"},{"line_number":815,"context_line":"    #         allocation.resource_class_id"},{"line_number":816,"context_line":"    # ) as usages ON"},{"line_number":817,"context_line":"    #     usages.resource_provider_id \u003d\u003d inv.resource_provider_id AND"},{"line_number":818,"context_line":"    #         usages.resource_class_id \u003d\u003d inv.resource_class_id"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_f20bfb20","line":815,"range":{"start_line":815,"start_character":14,"end_line":815,"end_character":24},"updated":"2017-10-24 17:29:35.000000000","message":"allocations","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e8ea6851d18543d37c78b73ff52088bd6d83c8c1","unresolved":false,"context_lines":[{"line_number":816,"context_line":"    # ) as usages ON"},{"line_number":817,"context_line":"    #     usages.resource_provider_id \u003d\u003d inv.resource_provider_id AND"},{"line_number":818,"context_line":"    #         usages.resource_class_id \u003d\u003d inv.resource_class_id"},{"line_number":819,"context_line":"    # WHERE ("},{"line_number":820,"context_line":"    #     inv.resource_class_id \u003d\u003d $VCPU_RC_CLASS_ID AND"},{"line_number":821,"context_line":"    #     ("},{"line_number":822,"context_line":"    #         COALESCE(usage.used, 0) + $AMOUNT_VCPU \u003c\u003d"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_72294b99","line":819,"range":{"start_line":819,"start_character":6,"end_line":819,"end_character":11},"updated":"2017-10-24 17:29:35.000000000","message":"I\u0027m concerned about the scoping of this.  We want this WHERE to apply only to the `usages` side of the LEFT JOIN; otherwise (I think) we will erroneously return IDs for RPs with inventories of all requested RCs exhausted.\n\nNeed a test case for that.\n\nOne remedy would be to stuff these conditions into the ON above.  Another would be some parens, however those manifest in sqlalchemy.","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6dfb810c982e2e845ff91882c227d27c13f80043","unresolved":false,"context_lines":[{"line_number":816,"context_line":"    # ) as usages ON"},{"line_number":817,"context_line":"    #     usages.resource_provider_id \u003d\u003d inv.resource_provider_id AND"},{"line_number":818,"context_line":"    #         usages.resource_class_id \u003d\u003d inv.resource_class_id"},{"line_number":819,"context_line":"    # WHERE ("},{"line_number":820,"context_line":"    #     inv.resource_class_id \u003d\u003d $VCPU_RC_CLASS_ID AND"},{"line_number":821,"context_line":"    #     ("},{"line_number":822,"context_line":"    #         COALESCE(usage.used, 0) + $AMOUNT_VCPU \u003c\u003d"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_8796af3d","line":819,"range":{"start_line":819,"start_character":6,"end_line":819,"end_character":11},"in_reply_to":"3f4b6375_338f4476","updated":"2017-10-25 13:10:25.000000000","message":"It may be moot, and/or I may be crazy.\n\nTL;DR: We need a test case to prove that we *don\u0027t* return an RP with exhausted usages in all the requested RCs.\n\nMy rambling analysis (feel free to skip this):\n\nRight now you\u0027ve got:\n\n SELECT FROM a LEFT JOIN b ON (...) WHERE (...)\n\nWhat I don\u0027t know is whether that gets processed as\n\n (1) SELECT FROM a LEFT JOIN [ b ON (...) WHERE (...) ]\n\nor as\n\n (2) SELECT FROM [ a LEFT JOIN b ON (...) ] WHERE (...)\n\nThe LEFT JOIN ensures that we get all the rows from `a` by the time that join is done, even if the right-hand side needs to be nulled to do it.  The WHERE filters rows out of whatever it gets applied to.\n\nIf this works as (1), the right-hand side of the LEFT JOIN is where we return usages that have available inventory.  In this case, if a right-hand-side row is null, it *either* means there\u0027s no usage at all, *or* there were usages that were exhausted.  We want to return that RP in the former case, but not in the latter.\n\nIf it works as (2), we start off with all RP rows whether usages exist or not; and *then* we do the WHERE filtering, which will remove any rows that don\u0027t have available inventory.  Except if a row\u0027s usage is null in this case, it still ought to hit because of the COALESCE thingy.\n\nSo I\u0027ve talked myself into a reversal of my original hypothesis: I now think (1) would be bad, and (2) is correct.  And I suspect (2) is what\u0027s really happening.  But we should have test cases to prove it.","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"ddb0b310d54cd3ed3db8c9d6b75c4bf3ba03d9bc","unresolved":false,"context_lines":[{"line_number":816,"context_line":"    # ) as usages ON"},{"line_number":817,"context_line":"    #     usages.resource_provider_id \u003d\u003d inv.resource_provider_id AND"},{"line_number":818,"context_line":"    #         usages.resource_class_id \u003d\u003d inv.resource_class_id"},{"line_number":819,"context_line":"    # WHERE ("},{"line_number":820,"context_line":"    #     inv.resource_class_id \u003d\u003d $VCPU_RC_CLASS_ID AND"},{"line_number":821,"context_line":"    #     ("},{"line_number":822,"context_line":"    #         COALESCE(usage.used, 0) + $AMOUNT_VCPU \u003c\u003d"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_338f4476","line":819,"range":{"start_line":819,"start_character":6,"end_line":819,"end_character":11},"in_reply_to":"3f4b6375_72294b99","updated":"2017-10-25 08:41:56.000000000","message":"sorry, I\u0027m not sure I get your point...","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"197f387bb3b4d622c0c99da320d78441b81cd8b5","unresolved":false,"context_lines":[{"line_number":816,"context_line":"    # ) as usages ON"},{"line_number":817,"context_line":"    #     usages.resource_provider_id \u003d\u003d inv.resource_provider_id AND"},{"line_number":818,"context_line":"    #         usages.resource_class_id \u003d\u003d inv.resource_class_id"},{"line_number":819,"context_line":"    # WHERE ("},{"line_number":820,"context_line":"    #     inv.resource_class_id \u003d\u003d $VCPU_RC_CLASS_ID AND"},{"line_number":821,"context_line":"    #     ("},{"line_number":822,"context_line":"    #         COALESCE(usage.used, 0) + $AMOUNT_VCPU \u003c\u003d"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_b5fbf5be","line":819,"range":{"start_line":819,"start_character":6,"end_line":819,"end_character":11},"in_reply_to":"3f4b6375_8796af3d","updated":"2017-10-26 09:48:11.000000000","message":"Finally I found this SQL doesn\u0027t works well, it missed the case, RP has more than one resource, but one of resource usage exhausted.\n\nSo I\u0027m going to rewrite this.","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"04ed9f17ec6e3fab274e3b001f288b9d15cc4d60","unresolved":false,"context_lines":[{"line_number":816,"context_line":"    # ) as usages ON"},{"line_number":817,"context_line":"    #     usages.resource_provider_id \u003d\u003d inv.resource_provider_id AND"},{"line_number":818,"context_line":"    #         usages.resource_class_id \u003d\u003d inv.resource_class_id"},{"line_number":819,"context_line":"    # WHERE ("},{"line_number":820,"context_line":"    #     inv.resource_class_id \u003d\u003d $VCPU_RC_CLASS_ID AND"},{"line_number":821,"context_line":"    #     ("},{"line_number":822,"context_line":"    #         COALESCE(usage.used, 0) + $AMOUNT_VCPU \u003c\u003d"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_96453173","line":819,"range":{"start_line":819,"start_character":6,"end_line":819,"end_character":11},"in_reply_to":"3f4b6375_b5fbf5be","updated":"2017-10-31 12:05:37.000000000","message":"Yeah, I was going to point that out :)","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"04ed9f17ec6e3fab274e3b001f288b9d15cc4d60","unresolved":false,"context_lines":[{"line_number":834,"context_line":"    #     ) AND"},{"line_number":835,"context_line":"    #     inv.min_unit \u003c\u003d $AMOUNT_MEM AND"},{"line_number":836,"context_line":"    #     inv.max_unit \u003e\u003d $AMOUNT_MEM AND"},{"line_number":837,"context_line":"    #     $AMOUNT_VCPU % inv.step_size \u003d\u003d 0"},{"line_number":838,"context_line":"    # ) OR"},{"line_number":839,"context_line":"    # ("},{"line_number":840,"context_line":"    #     inv.resource_class_id \u003d\u003d $DISK_RC_CLASS_ID AND"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_b64eed93","line":837,"range":{"start_line":837,"start_character":11,"end_line":837,"end_character":22},"updated":"2017-10-31 12:05:37.000000000","message":"AMOUNT_MEM :)","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e8ea6851d18543d37c78b73ff52088bd6d83c8c1","unresolved":false,"context_lines":[{"line_number":857,"context_line":"        sql.func.sum(_ALLOC_TBL.c.used).label(\u0027used\u0027)"},{"line_number":858,"context_line":"    ]).group_by("},{"line_number":859,"context_line":"        _ALLOC_TBL.c.resource_provider_id"},{"line_number":860,"context_line":"    ).group_by("},{"line_number":861,"context_line":"        _ALLOC_TBL.c.resource_class_id"},{"line_number":862,"context_line":"    ))"},{"line_number":863,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_1842393f","line":860,"range":{"start_line":860,"start_character":4,"end_line":860,"end_character":15},"updated":"2017-10-24 17:29:35.000000000","message":"redundant (replace with comma)","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e8ea6851d18543d37c78b73ff52088bd6d83c8c1","unresolved":false,"context_lines":[{"line_number":885,"context_line":"            (sql.func.coalesce(usage.c.used, 0) + amount) \u003c\u003d"},{"line_number":886,"context_line":"            (inv.c.total - inv.c.reserved) * inv.c.allocation_ratio"},{"line_number":887,"context_line":"            ),"},{"line_number":888,"context_line":"            inv.c.min_unit \u003c\u003d amount,"},{"line_number":889,"context_line":"            inv.c.max_unit \u003e\u003d amount,"},{"line_number":890,"context_line":"            amount % inv.c.step_size \u003d\u003d 0"},{"line_number":891,"context_line":"        ))"},{"line_number":892,"context_line":""},{"line_number":893,"context_line":"    sel \u003d sa.select("}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_b8b9e515","line":890,"range":{"start_line":888,"start_character":0,"end_line":890,"end_character":41},"updated":"2017-10-24 17:29:35.000000000","message":"More efficient to do these first?","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"04ed9f17ec6e3fab274e3b001f288b9d15cc4d60","unresolved":false,"context_lines":[{"line_number":885,"context_line":"            (sql.func.coalesce(usage.c.used, 0) + amount) \u003c\u003d"},{"line_number":886,"context_line":"            (inv.c.total - inv.c.reserved) * inv.c.allocation_ratio"},{"line_number":887,"context_line":"            ),"},{"line_number":888,"context_line":"            inv.c.min_unit \u003c\u003d amount,"},{"line_number":889,"context_line":"            inv.c.max_unit \u003e\u003d amount,"},{"line_number":890,"context_line":"            amount % inv.c.step_size \u003d\u003d 0"},{"line_number":891,"context_line":"        ))"},{"line_number":892,"context_line":""},{"line_number":893,"context_line":"    sel \u003d sa.select("}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_b6338d13","line":890,"range":{"start_line":888,"start_character":0,"end_line":890,"end_character":41},"in_reply_to":"3f4b6375_b8b9e515","updated":"2017-10-31 12:05:37.000000000","message":"No, the order of the expressions in an AND predicate is not important.","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"ddb0b310d54cd3ed3db8c9d6b75c4bf3ba03d9bc","unresolved":false,"context_lines":[{"line_number":885,"context_line":"            (sql.func.coalesce(usage.c.used, 0) + amount) \u003c\u003d"},{"line_number":886,"context_line":"            (inv.c.total - inv.c.reserved) * inv.c.allocation_ratio"},{"line_number":887,"context_line":"            ),"},{"line_number":888,"context_line":"            inv.c.min_unit \u003c\u003d amount,"},{"line_number":889,"context_line":"            inv.c.max_unit \u003e\u003d amount,"},{"line_number":890,"context_line":"            amount % inv.c.step_size \u003d\u003d 0"},{"line_number":891,"context_line":"        ))"},{"line_number":892,"context_line":""},{"line_number":893,"context_line":"    sel \u003d sa.select("}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_73993cc2","line":890,"range":{"start_line":888,"start_character":0,"end_line":890,"end_character":41},"in_reply_to":"3f4b6375_b8b9e515","updated":"2017-10-25 08:41:56.000000000","message":"yea, this is good point.","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e8ea6851d18543d37c78b73ff52088bd6d83c8c1","unresolved":false,"context_lines":[{"line_number":894,"context_line":"        [rpt.c.id, inv.c.resource_class_id, inv.c.total,"},{"line_number":895,"context_line":"         func.coalesce(usage.c.used, 0)])"},{"line_number":896,"context_line":"    sel \u003d sel.select_from(join_chain)"},{"line_number":897,"context_line":"    sel \u003d sel.where(sa.or_(*usage_cond))"},{"line_number":898,"context_line":""},{"line_number":899,"context_line":"    return set([r[0] for r in ctx.session.execute(sel)])"},{"line_number":900,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_f8dabd75","line":897,"range":{"start_line":897,"start_character":20,"end_line":897,"end_character":26},"updated":"2017-10-24 17:29:35.000000000","message":"We\u0027re going to need a variant of this method for numbered groupings where the only difference is that this is `sa.and_`.\n\nNo change needed now, I guess; more of a note to self.","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"df16ec64554a41c4980fe137e19a910257100cc6","unresolved":false,"context_lines":[{"line_number":804,"context_line":"    # For the request on the resource vcpu, memory an disk, the SQL is as"},{"line_number":805,"context_line":"    # below:"},{"line_number":806,"context_line":"    #"},{"line_number":807,"context_line":"    # SELECT DISTINCT(rp.id), rp.uuid"},{"line_number":808,"context_line":"    # FROM resource_providers AS rp"},{"line_number":809,"context_line":"    # LEFT JOIN inventories AS inv_vcpu"},{"line_number":810,"context_line":"    # ON rp.id \u003d\u003d inv_vcpu.resource_provider_id AND"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_008cc2d4","line":807,"range":{"start_line":807,"start_character":13,"end_line":807,"end_character":21},"updated":"2017-10-26 23:07:08.000000000","message":"Not anymore.\n\nThough a given rp.id will always correspond to the same rp.uuid, so you could SELECT DISTINCT(rp.id, rp.uuid).","commit_id":"db0d59dec46e219c4c29796db583fd45c6e62e00"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"df16ec64554a41c4980fe137e19a910257100cc6","unresolved":false,"context_lines":[{"line_number":817,"context_line":"    #     GROUP BY allocations.resource_provider_id,"},{"line_number":818,"context_line":"    #         allocations.resource_class_id"},{"line_number":819,"context_line":"    # ) AS usage_vcpu ON"},{"line_number":820,"context_line":"    #     usage_vcpu.resource_provider_id \u003d\u003d rp.id AND"},{"line_number":821,"context_line":"    # LEFT JOIN inventories AS inv_mem"},{"line_number":822,"context_line":"    # ON rp.id \u003d\u003d inv_mem.resource_provider_id AND"},{"line_number":823,"context_line":"    #     inv_mem.resource_class_id \u003d\u003d $MEM_RC_ID"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_e04e4695","line":820,"range":{"start_line":820,"start_character":51,"end_line":820,"end_character":54},"updated":"2017-10-26 23:07:08.000000000","message":"strike","commit_id":"db0d59dec46e219c4c29796db583fd45c6e62e00"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"b600d23539bb559f47125e75ea0ba460c8e129be","unresolved":false,"context_lines":[{"line_number":882,"context_line":"    #     )"},{"line_number":883,"context_line":"    # ) AND"},{"line_number":884,"context_line":"    # ("},{"line_number":885,"context_line":"    #     inv_vcpu.total is not NULL OR"},{"line_number":886,"context_line":"    #     inv_mem.total is not NULL OR"},{"line_number":887,"context_line":"    #     inv_disk.total is not NULL"},{"line_number":888,"context_line":"    # )"},{"line_number":889,"context_line":""},{"line_number":890,"context_line":"    rpt \u003d sa.alias(_RP_TBL, name\u003d\"rp\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_ff8fd172","line":887,"range":{"start_line":885,"start_character":0,"end_line":887,"end_character":36},"updated":"2017-10-28 17:56:26.000000000","message":"The bug is here.\n\nBecause we can succeed at a usage calculation above for one resource class because the total is NULL there...\n\n...and then succeed in this clause for a DIFFERENT resource class whose total is *not* NULL.\n\nSo the bug manifests when at least one requested resource class has no inventory; and the rest of the requested resource classes are exhausted or otherwise unsuitable due to inventory restrictions.","commit_id":"414ac87dc158935cec278148c0fd1ee405c9e77c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"50ff696d05cc8a487c53edd2fb91047542a7e257","unresolved":false,"context_lines":[{"line_number":882,"context_line":"    #     )"},{"line_number":883,"context_line":"    # ) AND"},{"line_number":884,"context_line":"    # ("},{"line_number":885,"context_line":"    #     inv_vcpu.total is not NULL OR"},{"line_number":886,"context_line":"    #     inv_mem.total is not NULL OR"},{"line_number":887,"context_line":"    #     inv_disk.total is not NULL"},{"line_number":888,"context_line":"    # )"},{"line_number":889,"context_line":""},{"line_number":890,"context_line":"    rpt \u003d sa.alias(_RP_TBL, name\u003d\"rp\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_28bbe70e","line":887,"range":{"start_line":885,"start_character":0,"end_line":887,"end_character":36},"in_reply_to":"3f4b6375_ff8fd172","updated":"2017-10-30 07:11:08.000000000","message":"no, I checked, the SQL is correct, the problem is one of allocation is override by another, see https://review.openstack.org/#/c/514197/4/nova/tests/functional/db/test_resource_provider.py@2403\n\nAllocationList.create always override the allocation for same user.","commit_id":"414ac87dc158935cec278148c0fd1ee405c9e77c"}],"nova/tests/functional/db/test_resource_provider.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dca036cb0f079c9c8b2aa78d3faca4f12a02c699","unresolved":false,"context_lines":[{"line_number":2374,"context_line":"                allocation_ratio\u003d16.0,"},{"line_number":2375,"context_line":"            )"},{"line_number":2376,"context_line":""},{"line_number":2377,"context_line":"            # cn2 doesn\u0027t have memory reosurce"},{"line_number":2378,"context_line":"            if cn.uuid \u003d\u003d cn1_uuid:"},{"line_number":2379,"context_line":"                memory_mb \u003d rp_obj.Inventory("},{"line_number":2380,"context_line":"                    resource_provider\u003dcn,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f4b6375_ef8563d0","line":2377,"range":{"start_line":2377,"start_character":38,"end_line":2377,"end_character":46},"updated":"2017-10-24 10:42:42.000000000","message":"resource","commit_id":"afcdea19cfcaaf870f430fe9b5e420164c01017f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e8ea6851d18543d37c78b73ff52088bd6d83c8c1","unresolved":false,"context_lines":[{"line_number":2374,"context_line":"                allocation_ratio\u003d16.0,"},{"line_number":2375,"context_line":"            )"},{"line_number":2376,"context_line":""},{"line_number":2377,"context_line":"            # cn2 doesn\u0027t have memory reosurce"},{"line_number":2378,"context_line":"            if cn.uuid \u003d\u003d cn1_uuid:"},{"line_number":2379,"context_line":"                memory_mb \u003d rp_obj.Inventory("},{"line_number":2380,"context_line":"                    resource_provider\u003dcn,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_127c5770","line":2377,"range":{"start_line":2377,"start_character":38,"end_line":2377,"end_character":46},"updated":"2017-10-24 17:29:35.000000000","message":"resource","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e8ea6851d18543d37c78b73ff52088bd6d83c8c1","unresolved":false,"context_lines":[{"line_number":2421,"context_line":"            self._requested_resources())"},{"line_number":2422,"context_line":""},{"line_number":2423,"context_line":"        self.assertEqual(set([cn1.id, cn2.id]), res)"},{"line_number":2424,"context_line":""},{"line_number":2425,"context_line":""},{"line_number":2426,"context_line":"class AllocationCandidatesTestCase(ResourceProviderBaseCase):"},{"line_number":2427,"context_line":"    \"\"\"Tests a variety of scenarios with both shared and non-shared resource"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_f22adb29","line":2424,"updated":"2017-10-24 17:29:35.000000000","message":"There\u0027s a lot that this isn\u0027t testing.\n\n- The allocations pieces aren\u0027t being exercised at all.\n- We should have some RPs in the \"database\" that don\u0027t match at all (are excluded from the result): some because they have insufficient inventory in all resource classes; some because they lack the requested resource classes entirely.","commit_id":"1788cfc9014d763b58fdeea711eb1bb9a44e00d1"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"3a5c109bb67e4c4052167eccbb24dfd3ada427a5","unresolved":false,"context_lines":[{"line_number":2363,"context_line":"        ).create_all()"},{"line_number":2364,"context_line":""},{"line_number":2365,"context_line":"    def test_get_providers_with_any_resource(self):"},{"line_number":2366,"context_line":"        # These RPs are named based on whether we expect them to be \u0027incl\u0027uded"},{"line_number":2367,"context_line":"        # or \u0027excl\u0027uded in the result."},{"line_number":2368,"context_line":""},{"line_number":2369,"context_line":"        # No inventory records.  This one should never show up in a result."},{"line_number":2370,"context_line":"        self._mk_rp(\u0027no_inventory\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_9b6811f5","line":2367,"range":{"start_line":2366,"start_character":68,"end_line":2367,"end_character":23},"updated":"2017-10-27 06:54:16.000000000","message":"This is smart way :)","commit_id":"414ac87dc158935cec278148c0fd1ee405c9e77c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"3a5c109bb67e4c4052167eccbb24dfd3ada427a5","unresolved":false,"context_lines":[{"line_number":2377,"context_line":""},{"line_number":2378,"context_line":"        # No allocations, but inventory unusable"},{"line_number":2379,"context_line":"        excl_badinv_noalloc \u003d self._mk_rp(\u0027badinv_noalloc\u0027)"},{"line_number":2380,"context_line":"        # Not enough total"},{"line_number":2381,"context_line":"        self._add_inv(excl_badinv_noalloc, fields.ResourceClass.VCPU, 4)"},{"line_number":2382,"context_line":"        # Too much reserved"},{"line_number":2383,"context_line":"        self._add_inv(excl_badinv_noalloc, fields.ResourceClass.MEMORY_MB,"},{"line_number":2384,"context_line":"                      4096, max_unit\u003d2048, reserved\u003d3500)"},{"line_number":2385,"context_line":"        # Max unit too low"},{"line_number":2386,"context_line":"        self._add_inv(excl_badinv_noalloc, fields.ResourceClass.DISK_GB, 2000,"},{"line_number":2387,"context_line":"                      max_unit\u003d1000)"},{"line_number":2388,"context_line":""},{"line_number":2389,"context_line":"        # Inventory consumed in one RC, but available in one"},{"line_number":2390,"context_line":"        incl_1invavail \u003d self._mk_rp(\u00271invavail\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_3b8b5dc3","line":2387,"range":{"start_line":2380,"start_character":8,"end_line":2387,"end_character":36},"updated":"2017-10-27 06:54:16.000000000","message":"One of this inventory will filter out this RP. So we should have separate RP for this three cases","commit_id":"414ac87dc158935cec278148c0fd1ee405c9e77c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"dde9a10aa9c570c5a0c315af485bc0764b9a7ef3","unresolved":false,"context_lines":[{"line_number":2377,"context_line":""},{"line_number":2378,"context_line":"        # No allocations, but inventory unusable"},{"line_number":2379,"context_line":"        excl_badinv_noalloc \u003d self._mk_rp(\u0027badinv_noalloc\u0027)"},{"line_number":2380,"context_line":"        # Not enough total"},{"line_number":2381,"context_line":"        self._add_inv(excl_badinv_noalloc, fields.ResourceClass.VCPU, 4)"},{"line_number":2382,"context_line":"        # Too much reserved"},{"line_number":2383,"context_line":"        self._add_inv(excl_badinv_noalloc, fields.ResourceClass.MEMORY_MB,"},{"line_number":2384,"context_line":"                      4096, max_unit\u003d2048, reserved\u003d3500)"},{"line_number":2385,"context_line":"        # Max unit too low"},{"line_number":2386,"context_line":"        self._add_inv(excl_badinv_noalloc, fields.ResourceClass.DISK_GB, 2000,"},{"line_number":2387,"context_line":"                      max_unit\u003d1000)"},{"line_number":2388,"context_line":""},{"line_number":2389,"context_line":"        # Inventory consumed in one RC, but available in one"},{"line_number":2390,"context_line":"        incl_1invavail \u003d self._mk_rp(\u00271invavail\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_a2a12e98","line":2387,"range":{"start_line":2380,"start_character":8,"end_line":2387,"end_character":36},"in_reply_to":"3f4b6375_3b8b5dc3","updated":"2017-10-30 12:03:54.000000000","message":"Wait, what do you mean?  It takes all three of these guys being bad to exclude this RP.\n\nAre you saying we should have each of these split up along with an inventory that *does* have viable resources, to make sure we *include* that RP?  Or split them up so each is by itself (with no other viable inventory) to make sure they get excluded?","commit_id":"414ac87dc158935cec278148c0fd1ee405c9e77c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"3a5c109bb67e4c4052167eccbb24dfd3ada427a5","unresolved":false,"context_lines":[{"line_number":2387,"context_line":"                      max_unit\u003d1000)"},{"line_number":2388,"context_line":""},{"line_number":2389,"context_line":"        # Inventory consumed in one RC, but available in one"},{"line_number":2390,"context_line":"        incl_1invavail \u003d self._mk_rp(\u00271invavail\u0027)"},{"line_number":2391,"context_line":"        self._add_inv(incl_1invavail, fields.ResourceClass.VCPU, 10)"},{"line_number":2392,"context_line":"        self._add_alloc(incl_1invavail, fields.ResourceClass.VCPU, 7)"},{"line_number":2393,"context_line":"        self._add_inv(incl_1invavail, fields.ResourceClass.DISK_GB, 2000)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_1bd8a1ec","line":2390,"range":{"start_line":2390,"start_character":38,"end_line":2390,"end_character":47},"updated":"2017-10-27 06:54:16.000000000","message":"What does this means?","commit_id":"414ac87dc158935cec278148c0fd1ee405c9e77c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"dde9a10aa9c570c5a0c315af485bc0764b9a7ef3","unresolved":false,"context_lines":[{"line_number":2387,"context_line":"                      max_unit\u003d1000)"},{"line_number":2388,"context_line":""},{"line_number":2389,"context_line":"        # Inventory consumed in one RC, but available in one"},{"line_number":2390,"context_line":"        incl_1invavail \u003d self._mk_rp(\u00271invavail\u0027)"},{"line_number":2391,"context_line":"        self._add_inv(incl_1invavail, fields.ResourceClass.VCPU, 10)"},{"line_number":2392,"context_line":"        self._add_alloc(incl_1invavail, fields.ResourceClass.VCPU, 7)"},{"line_number":2393,"context_line":"        self._add_inv(incl_1invavail, fields.ResourceClass.DISK_GB, 2000)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_621a1618","line":2390,"range":{"start_line":2390,"start_character":38,"end_line":2390,"end_character":47},"in_reply_to":"3f4b6375_1bd8a1ec","updated":"2017-10-30 12:03:54.000000000","message":"\"one inventory available\"\n\nSorry.\n\nFeel free to make a better name :)","commit_id":"414ac87dc158935cec278148c0fd1ee405c9e77c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"50ff696d05cc8a487c53edd2fb91047542a7e257","unresolved":false,"context_lines":[{"line_number":2400,"context_line":"        self._add_alloc(excl_allused, fields.ResourceClass.MEMORY_MB, 2000,"},{"line_number":2401,"context_line":"                        consumer_id\u003duuidsentinel.consumer2)"},{"line_number":2402,"context_line":"        self._add_inv(excl_allused, fields.ResourceClass.DISK_GB, 1500)"},{"line_number":2403,"context_line":"        self._add_alloc(excl_allused, fields.ResourceClass.DISK_GB, 1)"},{"line_number":2404,"context_line":""},{"line_number":2405,"context_line":"        # Inventory available in a requested class, but unavailable in others"},{"line_number":2406,"context_line":"        incl_extra_full \u003d self._mk_rp(\u0027extra_full\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_88dbfb7b","line":2403,"range":{"start_line":2403,"start_character":8,"end_line":2403,"end_character":70},"updated":"2017-10-30 07:11:08.000000000","message":"This overrides the allocation at line 2399, since they are same consumer","commit_id":"414ac87dc158935cec278148c0fd1ee405c9e77c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"dde9a10aa9c570c5a0c315af485bc0764b9a7ef3","unresolved":false,"context_lines":[{"line_number":2400,"context_line":"        self._add_alloc(excl_allused, fields.ResourceClass.MEMORY_MB, 2000,"},{"line_number":2401,"context_line":"                        consumer_id\u003duuidsentinel.consumer2)"},{"line_number":2402,"context_line":"        self._add_inv(excl_allused, fields.ResourceClass.DISK_GB, 1500)"},{"line_number":2403,"context_line":"        self._add_alloc(excl_allused, fields.ResourceClass.DISK_GB, 1)"},{"line_number":2404,"context_line":""},{"line_number":2405,"context_line":"        # Inventory available in a requested class, but unavailable in others"},{"line_number":2406,"context_line":"        incl_extra_full \u003d self._mk_rp(\u0027extra_full\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_62c8d673","line":2403,"range":{"start_line":2403,"start_character":8,"end_line":2403,"end_character":70},"in_reply_to":"3f4b6375_88dbfb7b","updated":"2017-10-30 12:03:54.000000000","message":"Sweet, good find.","commit_id":"414ac87dc158935cec278148c0fd1ee405c9e77c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"df16ec64554a41c4980fe137e19a910257100cc6","unresolved":false,"context_lines":[{"line_number":2434,"context_line":"            fields.ResourceClass.STANDARD.index("},{"line_number":2435,"context_line":"                fields.ResourceClass.MEMORY_MB): 1024,"},{"line_number":2436,"context_line":"            fields.ResourceClass.STANDARD.index("},{"line_number":2437,"context_line":"                fields.ResourceClass.DISK_GB): 1500,}"},{"line_number":2438,"context_line":""},{"line_number":2439,"context_line":"        # Run it!"},{"line_number":2440,"context_line":"        res \u003d rp_obj._get_providers_with_any_resource(self.ctx, resources)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_5bb4e07f","line":2437,"range":{"start_line":2437,"start_character":51,"end_line":2437,"end_character":52},"updated":"2017-10-26 23:07:08.000000000","message":"Yeah, I\u0027m not gonna restack for this at the moment, but this is the pep8 failure.","commit_id":"414ac87dc158935cec278148c0fd1ee405c9e77c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"3a5c109bb67e4c4052167eccbb24dfd3ada427a5","unresolved":false,"context_lines":[{"line_number":2441,"context_line":""},{"line_number":2442,"context_line":"        # TODO(efried/alex_xu): We expect only these"},{"line_number":2443,"context_line":"        expected \u003d [incl_big_cm_noalloc, incl_1invavail, incl_extra_full]"},{"line_number":2444,"context_line":"        # TODO(efried/alex_xu): But we\u0027re also getting this one!"},{"line_number":2445,"context_line":"        expected.append(excl_allused)"},{"line_number":2446,"context_line":""},{"line_number":2447,"context_line":"        self.assertEqual({rp.id: rp.uuid for rp in expected}, res)"},{"line_number":2448,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_a64f3469","line":2445,"range":{"start_line":2444,"start_character":8,"end_line":2445,"end_character":37},"updated":"2017-10-27 06:54:16.000000000","message":"interesting!","commit_id":"414ac87dc158935cec278148c0fd1ee405c9e77c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3705d7e5c323137472d2c07172520c41d5c1e1ee","unresolved":false,"context_lines":[{"line_number":2468,"context_line":""},{"line_number":2469,"context_line":"class ProviderDBHelperTestCase(ResourceProviderBaseCase):"},{"line_number":2470,"context_line":""},{"line_number":2471,"context_line":"    def _requested_resources(self):"},{"line_number":2472,"context_line":"        \"\"\"This method returns a dict of the requested resources. The key is"},{"line_number":2473,"context_line":"        the resource class id, the value is requested amount of this resource."},{"line_number":2474,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f4b6375_25ae37e7","line":2471,"range":{"start_line":2471,"start_character":8,"end_line":2471,"end_character":28},"updated":"2017-11-01 14:46:38.000000000","message":"Not used","commit_id":"b885edb6c46b5315cdbc437d77e605be40413b5e"}]}
