)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"bb83d6774160dc6d575862d9a36d0c70167a4be8","unresolved":false,"context_lines":[{"line_number":26,"context_line":"- The same request, but with a required trait that nobody has, shorts"},{"line_number":27,"context_line":"  out quickly:"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":" found 0 providers after applying required traits filter ({\u0027HW_CPU_X86_AVX2\u0027: 65})"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"- A request for one resource with aggregates and forbidden (but no"},{"line_number":32,"context_line":"  required) traits:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"3f79a3b5_c526f368","line":29,"range":{"start_line":29,"start_character":77,"end_line":29,"end_character":80},"updated":"2018-08-15 03:30:46.000000000","message":"nit: We could remove the internal ID from here. It is as if a user has requested 65 AVX traits, which might confuse operators.","commit_id":"4a93b316b9556df1a577d4da47765970daa95abd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"7b2fa5fd30004bf4b20b25cbae574136ddf0f681","unresolved":false,"context_lines":[{"line_number":26,"context_line":"- The same request, but with a required trait that nobody has, shorts"},{"line_number":27,"context_line":"  out quickly:"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":" found 0 providers after applying required traits filter ({\u0027HW_CPU_X86_AVX2\u0027: 65})"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"- A request for one resource with aggregates and forbidden (but no"},{"line_number":32,"context_line":"  required) traits:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"3f79a3b5_304d9c3d","line":29,"range":{"start_line":29,"start_character":77,"end_line":29,"end_character":80},"in_reply_to":"3f79a3b5_c526f368","updated":"2018-08-15 12:53:11.000000000","message":"yeah, that\u0027s a good point, Tetsuro. ++","commit_id":"4a93b316b9556df1a577d4da47765970daa95abd"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7cbfed5685dcbc3d41132ed7437a9fedbab89340","unresolved":false,"context_lines":[{"line_number":21,"context_line":" found 9 providers with available 1024 MEMORY_MB"},{"line_number":22,"context_line":"       5 after filtering by previous result"},{"line_number":23,"context_line":" found 8 providers with available 1500 DISK_GB"},{"line_number":24,"context_line":"       2 after filtering by previous result"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"- The same request, but with a required trait that nobody has, shorts"},{"line_number":27,"context_line":"  out quickly:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"3f79a3b5_ddaed42c","line":24,"updated":"2018-08-24 23:22:48.000000000","message":"I managed to miss this example before I took a look at the gate run logs. I see now what the original thinking was for the last message, however, because of all the extra noise in the real DEBUG logs, it was hard to follow the last message context sharing with the others. The latest PS makes the real log easier to parse, at least for me.","commit_id":"b5afb6b171c08cb21856c614f664dc90c9a2dfbb"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"80ad4d747800f34457a04b02789ff99f8e3cd73b","unresolved":false,"context_lines":[{"line_number":21,"context_line":" found 9 providers with available 1024 MEMORY_MB"},{"line_number":22,"context_line":"       5 after filtering by previous result"},{"line_number":23,"context_line":" found 8 providers with available 1500 DISK_GB"},{"line_number":24,"context_line":"       2 after filtering by previous result"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"- The same request, but with a required trait that nobody has, shorts"},{"line_number":27,"context_line":"  out quickly:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"3f79a3b5_4405fa44","line":24,"in_reply_to":"3f79a3b5_07363604","updated":"2018-08-27 13:51:43.000000000","message":"Done","commit_id":"b5afb6b171c08cb21856c614f664dc90c9a2dfbb"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"47621c7c985700dfddc109ac01a0a0ee55e6fe63","unresolved":false,"context_lines":[{"line_number":21,"context_line":" found 9 providers with available 1024 MEMORY_MB"},{"line_number":22,"context_line":"       5 after filtering by previous result"},{"line_number":23,"context_line":" found 8 providers with available 1500 DISK_GB"},{"line_number":24,"context_line":"       2 after filtering by previous result"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"- The same request, but with a required trait that nobody has, shorts"},{"line_number":27,"context_line":"  out quickly:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"3f79a3b5_07363604","line":24,"in_reply_to":"3f79a3b5_ddaed42c","updated":"2018-08-25 15:40:59.000000000","message":"argh, I forgot to update these examples when I respun.","commit_id":"b5afb6b171c08cb21856c614f664dc90c9a2dfbb"}],"nova/api/openstack/placement/objects/resource_provider.py":[{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"4e05645a0da1d85bcba97c47845aa775aeba4cee","unresolved":false,"context_lines":[{"line_number":2857,"context_line":"        # or have any forbidden trait"},{"line_number":2858,"context_line":"        if forbidden_rp_ids:"},{"line_number":2859,"context_line":"            rc_rp_ids ^\u003d forbidden_rp_ids"},{"line_number":2860,"context_line":""},{"line_number":2861,"context_line":"        # Now trim back provs_with_resource to only those providers with IDs"},{"line_number":2862,"context_line":"        # still in our rc_rp_ids set. We reset our results (matching_rps) to"},{"line_number":2863,"context_line":"        # only those matched in the above set calculations"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_660afe8a","line":2860,"updated":"2018-08-09 07:36:42.000000000","message":"Can we add one more shortcut here, something like:\n\n        if not rc_rp_ids:\n            LOG.debug(\"found 0 providers with required traits, aggregates and\"\n                      \"without forbidden traits with resources\")\n            return []\n\nOtherwise, we would have \"non-rc provider with traits\" revive in the next iteration, which produces a bug described in https://review.openstack.org/#/c/590150/.","commit_id":"eb58da40ca97922285b5d7662fc1db57f9bda6d1"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f984d78d8153b55f6554206063755979e0218692","unresolved":false,"context_lines":[{"line_number":2857,"context_line":"        # or have any forbidden trait"},{"line_number":2858,"context_line":"        if forbidden_rp_ids:"},{"line_number":2859,"context_line":"            rc_rp_ids ^\u003d forbidden_rp_ids"},{"line_number":2860,"context_line":""},{"line_number":2861,"context_line":"        # Now trim back provs_with_resource to only those providers with IDs"},{"line_number":2862,"context_line":"        # still in our rc_rp_ids set. We reset our results (matching_rps) to"},{"line_number":2863,"context_line":"        # only those matched in the above set calculations"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_ddeab873","line":2860,"in_reply_to":"3f79a3b5_660afe8a","updated":"2018-08-10 21:29:59.000000000","message":"ack, will see what I can do.","commit_id":"eb58da40ca97922285b5d7662fc1db57f9bda6d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"eded1d99d5b96e450877cc31cfd59878e8db6707","unresolved":false,"context_lines":[{"line_number":2833,"context_line":"                      supplied aggregates of each aggregate UUID list."},{"line_number":2834,"context_line":"    \"\"\""},{"line_number":2835,"context_line":"    # A dict, keyed by internal provider ID, of tuples of (internal provider"},{"line_number":2836,"context_line":"    # ID, root provider ID) that match all the conditions we\u0027re looking for"},{"line_number":2837,"context_line":"    # (the values() of this dict are returned from this function)"},{"line_number":2838,"context_line":"    matching_rps \u003d {}"},{"line_number":2839,"context_line":"    trait_rps \u003d set()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_70727e4b","line":2836,"range":{"start_line":2836,"start_character":10,"end_line":2836,"end_character":26},"updated":"2018-08-10 20:12:48.000000000","message":"internal?","commit_id":"2a10b87addae77e4a817a6a4bd712b017b25dd10"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f984d78d8153b55f6554206063755979e0218692","unresolved":false,"context_lines":[{"line_number":2833,"context_line":"                      supplied aggregates of each aggregate UUID list."},{"line_number":2834,"context_line":"    \"\"\""},{"line_number":2835,"context_line":"    # A dict, keyed by internal provider ID, of tuples of (internal provider"},{"line_number":2836,"context_line":"    # ID, root provider ID) that match all the conditions we\u0027re looking for"},{"line_number":2837,"context_line":"    # (the values() of this dict are returned from this function)"},{"line_number":2838,"context_line":"    matching_rps \u003d {}"},{"line_number":2839,"context_line":"    trait_rps \u003d set()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_c096214d","line":2836,"range":{"start_line":2836,"start_character":10,"end_line":2836,"end_character":26},"in_reply_to":"3f79a3b5_70727e4b","updated":"2018-08-10 21:29:59.000000000","message":"Done","commit_id":"2a10b87addae77e4a817a6a4bd712b017b25dd10"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"eded1d99d5b96e450877cc31cfd59878e8db6707","unresolved":false,"context_lines":[{"line_number":2860,"context_line":"    if forbidden_traits:"},{"line_number":2861,"context_line":"        forbidden_rp_ids \u003d _get_provider_ids_having_any_trait("},{"line_number":2862,"context_line":"            ctx, forbidden_traits)"},{"line_number":2863,"context_line":""},{"line_number":2864,"context_line":"    # Instead of constructing a giant complex SQL statement that joins multiple"},{"line_number":2865,"context_line":"    # copies of derived usage tables and inventory tables to each other, we do"},{"line_number":2866,"context_line":"    # one query for each requested resource class. This allows us to log a"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_b05ed641","line":2863,"updated":"2018-08-10 20:12:48.000000000","message":"Pretty sure we could precombine trait_rps, rps_in_aggs, and forbidden_rp_ids at this point. If empty, short out. And then in the loop below we would only have one set to \u0026 with.\n\n filt_rps \u003d (trait_rps \u0026 rps_in_aggs) - forbidden_rp_ids\n\n[Later] Okay, it\u0027s not *quite* that simple, but it\u0027s still doable. See https://review.openstack.org/591073","commit_id":"2a10b87addae77e4a817a6a4bd712b017b25dd10"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f984d78d8153b55f6554206063755979e0218692","unresolved":false,"context_lines":[{"line_number":2860,"context_line":"    if forbidden_traits:"},{"line_number":2861,"context_line":"        forbidden_rp_ids \u003d _get_provider_ids_having_any_trait("},{"line_number":2862,"context_line":"            ctx, forbidden_traits)"},{"line_number":2863,"context_line":""},{"line_number":2864,"context_line":"    # Instead of constructing a giant complex SQL statement that joins multiple"},{"line_number":2865,"context_line":"    # copies of derived usage tables and inventory tables to each other, we do"},{"line_number":2866,"context_line":"    # one query for each requested resource class. This allows us to log a"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_c04ce143","line":2863,"in_reply_to":"3f79a3b5_b05ed641","updated":"2018-08-10 21:29:59.000000000","message":"I find it easier to read and consume the way it is here.","commit_id":"2a10b87addae77e4a817a6a4bd712b017b25dd10"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"eded1d99d5b96e450877cc31cfd59878e8db6707","unresolved":false,"context_lines":[{"line_number":2889,"context_line":"        # If we\u0027ve already found providers matching a previous resource class,"},{"line_number":2890,"context_line":"        # make sure we only include providers that have both resources."},{"line_number":2891,"context_line":"        if matching_rps:"},{"line_number":2892,"context_line":"            rc_rp_ids \u0026\u003d set(matching_rps)"},{"line_number":2893,"context_line":""},{"line_number":2894,"context_line":"        LOG.debug(\"inside %s request loop. before applying trait and \""},{"line_number":2895,"context_line":"                  \"aggregate filters, found %d matching providers\","}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_10df8a0d","line":2892,"range":{"start_line":2892,"start_character":12,"end_line":2892,"end_character":42},"updated":"2018-08-10 20:12:48.000000000","message":"Opportunity to short out if this winds up empty.\n\n[Later] I guess the remainder of this loop is just set math (no more db calls), which ought to be pretty quick. But even so, you could still short out at each of the \u0026\u003ds.","commit_id":"2a10b87addae77e4a817a6a4bd712b017b25dd10"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f984d78d8153b55f6554206063755979e0218692","unresolved":false,"context_lines":[{"line_number":2889,"context_line":"        # If we\u0027ve already found providers matching a previous resource class,"},{"line_number":2890,"context_line":"        # make sure we only include providers that have both resources."},{"line_number":2891,"context_line":"        if matching_rps:"},{"line_number":2892,"context_line":"            rc_rp_ids \u0026\u003d set(matching_rps)"},{"line_number":2893,"context_line":""},{"line_number":2894,"context_line":"        LOG.debug(\"inside %s request loop. before applying trait and \""},{"line_number":2895,"context_line":"                  \"aggregate filters, found %d matching providers\","}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_805269dd","line":2892,"range":{"start_line":2892,"start_character":12,"end_line":2892,"end_character":42},"in_reply_to":"3f79a3b5_10df8a0d","updated":"2018-08-10 21:29:59.000000000","message":"Done","commit_id":"2a10b87addae77e4a817a6a4bd712b017b25dd10"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"eded1d99d5b96e450877cc31cfd59878e8db6707","unresolved":false,"context_lines":[{"line_number":2908,"context_line":"                      rc_name, len(rc_rp_ids))"},{"line_number":2909,"context_line":"        # or have any forbidden trait"},{"line_number":2910,"context_line":"        if forbidden_rp_ids:"},{"line_number":2911,"context_line":"            rc_rp_ids ^\u003d forbidden_rp_ids"},{"line_number":2912,"context_line":"            LOG.debug(\"inside %s request loop. after applying forbidden \""},{"line_number":2913,"context_line":"                      \"traits filter, found %d matching providers\","},{"line_number":2914,"context_line":"                      rc_name, len(rc_rp_ids))"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_90571a59","line":2911,"range":{"start_line":2911,"start_character":22,"end_line":2911,"end_character":23},"updated":"2018-08-10 20:12:48.000000000","message":"This should be - not ^\n\nWe want to remove everything in forbidden_rp_ids from rc_rp_ids. This will add anything from forbidden_rp_ids that wasn\u0027t originally in rc_rp_ids, which is extremely not what we want.\n\n In [9]: rc_rp_ids \u003d {1, 2, 3}\n\n In [10]: forbidden_trait_ids \u003d {3, 4, 5}\n\n In [11]: rc_rp_ids ^\u003d forbidden_trait_ids\n\n In [12]: rc_rp_ids\n Out[12]: {1, 2, 4, 5}\n\n In [13]: rc_rp_ids \u003d {1, 2, 3}\n\n In [14]: rc_rp_ids -\u003d forbidden_trait_ids\n\n In [15]: rc_rp_ids\n Out[15]: {1, 2}\n\nI wrote a test case to flush this out: https://review.openstack.org/591070","commit_id":"2a10b87addae77e4a817a6a4bd712b017b25dd10"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f984d78d8153b55f6554206063755979e0218692","unresolved":false,"context_lines":[{"line_number":2908,"context_line":"                      rc_name, len(rc_rp_ids))"},{"line_number":2909,"context_line":"        # or have any forbidden trait"},{"line_number":2910,"context_line":"        if forbidden_rp_ids:"},{"line_number":2911,"context_line":"            rc_rp_ids ^\u003d forbidden_rp_ids"},{"line_number":2912,"context_line":"            LOG.debug(\"inside %s request loop. after applying forbidden \""},{"line_number":2913,"context_line":"                      \"traits filter, found %d matching providers\","},{"line_number":2914,"context_line":"                      rc_name, len(rc_rp_ids))"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_20f6f5fa","line":2911,"range":{"start_line":2911,"start_character":22,"end_line":2911,"end_character":23},"in_reply_to":"3f79a3b5_90571a59","updated":"2018-08-10 21:29:59.000000000","message":"Done","commit_id":"2a10b87addae77e4a817a6a4bd712b017b25dd10"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"eded1d99d5b96e450877cc31cfd59878e8db6707","unresolved":false,"context_lines":[{"line_number":2919,"context_line":"                      \"requested %d %s\", rc_name, amount, rc_name)"},{"line_number":2920,"context_line":"            return []"},{"line_number":2921,"context_line":""},{"line_number":2922,"context_line":"        # Now trim back provs_with_resource to only those providers with IDs"},{"line_number":2923,"context_line":"        # still in our rc_rp_ids set. We reset our results (matching_rps) to"},{"line_number":2924,"context_line":"        # only those matched in the above set calculations"},{"line_number":2925,"context_line":"        matching_rps \u003d {}"},{"line_number":2926,"context_line":"        for prov_ids in provs_with_resource:"},{"line_number":2927,"context_line":"            if prov_ids[0] in rc_rp_ids:"},{"line_number":2928,"context_line":"                matching_rps[prov_ids[0]] \u003d prov_ids"},{"line_number":2929,"context_line":""},{"line_number":2930,"context_line":"        if start_num_matches \u003d\u003d 0:"},{"line_number":2931,"context_line":"            LOG.debug(\"found %d providers with capacity for the requested \""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_ab6bcb1b","line":2928,"range":{"start_line":2922,"start_character":0,"end_line":2928,"end_character":52},"updated":"2018-08-10 20:12:48.000000000","message":"This could be done outside of the loop, using whatever provs_with_resource is after the last iteration, because it\u0027s guaranteed to contain a superset of your final matches.\n\n[Later] Included this in https://review.openstack.org/591073","commit_id":"2a10b87addae77e4a817a6a4bd712b017b25dd10"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f984d78d8153b55f6554206063755979e0218692","unresolved":false,"context_lines":[{"line_number":2919,"context_line":"                      \"requested %d %s\", rc_name, amount, rc_name)"},{"line_number":2920,"context_line":"            return []"},{"line_number":2921,"context_line":""},{"line_number":2922,"context_line":"        # Now trim back provs_with_resource to only those providers with IDs"},{"line_number":2923,"context_line":"        # still in our rc_rp_ids set. We reset our results (matching_rps) to"},{"line_number":2924,"context_line":"        # only those matched in the above set calculations"},{"line_number":2925,"context_line":"        matching_rps \u003d {}"},{"line_number":2926,"context_line":"        for prov_ids in provs_with_resource:"},{"line_number":2927,"context_line":"            if prov_ids[0] in rc_rp_ids:"},{"line_number":2928,"context_line":"                matching_rps[prov_ids[0]] \u003d prov_ids"},{"line_number":2929,"context_line":""},{"line_number":2930,"context_line":"        if start_num_matches \u003d\u003d 0:"},{"line_number":2931,"context_line":"            LOG.debug(\"found %d providers with capacity for the requested \""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_a0e1a52c","line":2928,"range":{"start_line":2922,"start_character":0,"end_line":2928,"end_character":52},"in_reply_to":"3f79a3b5_ab6bcb1b","updated":"2018-08-10 21:29:59.000000000","message":"Done","commit_id":"2a10b87addae77e4a817a6a4bd712b017b25dd10"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"eded1d99d5b96e450877cc31cfd59878e8db6707","unresolved":false,"context_lines":[{"line_number":2927,"context_line":"            if prov_ids[0] in rc_rp_ids:"},{"line_number":2928,"context_line":"                matching_rps[prov_ids[0]] \u003d prov_ids"},{"line_number":2929,"context_line":""},{"line_number":2930,"context_line":"        if start_num_matches \u003d\u003d 0:"},{"line_number":2931,"context_line":"            LOG.debug(\"found %d providers with capacity for the requested \""},{"line_number":2932,"context_line":"                      \"%d %s. \", len(provs_with_resource), amount, rc_name)"},{"line_number":2933,"context_line":"        else:"},{"line_number":2934,"context_line":"            LOG.debug(\"found %d providers with capacity for the requested \""},{"line_number":2935,"context_line":"                      \"%d %s. before loop iteration we had %d matches.\","},{"line_number":2936,"context_line":"                      len(provs_with_resource), amount, rc_name,"},{"line_number":2937,"context_line":"                      start_num_matches)"},{"line_number":2938,"context_line":""},{"line_number":2939,"context_line":"    return matching_rps.values()"},{"line_number":2940,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_8b57ef58","line":2937,"range":{"start_line":2930,"start_character":0,"end_line":2937,"end_character":40},"updated":"2018-08-10 20:12:48.000000000","message":"I think you meant to show len(matching_rps) here. (Or just len(rc_rp_ids), if you follow the above and move the final construction of matching_rps outside of the loop.)","commit_id":"2a10b87addae77e4a817a6a4bd712b017b25dd10"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f984d78d8153b55f6554206063755979e0218692","unresolved":false,"context_lines":[{"line_number":2927,"context_line":"            if prov_ids[0] in rc_rp_ids:"},{"line_number":2928,"context_line":"                matching_rps[prov_ids[0]] \u003d prov_ids"},{"line_number":2929,"context_line":""},{"line_number":2930,"context_line":"        if start_num_matches \u003d\u003d 0:"},{"line_number":2931,"context_line":"            LOG.debug(\"found %d providers with capacity for the requested \""},{"line_number":2932,"context_line":"                      \"%d %s. \", len(provs_with_resource), amount, rc_name)"},{"line_number":2933,"context_line":"        else:"},{"line_number":2934,"context_line":"            LOG.debug(\"found %d providers with capacity for the requested \""},{"line_number":2935,"context_line":"                      \"%d %s. before loop iteration we had %d matches.\","},{"line_number":2936,"context_line":"                      len(provs_with_resource), amount, rc_name,"},{"line_number":2937,"context_line":"                      start_num_matches)"},{"line_number":2938,"context_line":""},{"line_number":2939,"context_line":"    return matching_rps.values()"},{"line_number":2940,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_20cfd5b0","line":2937,"range":{"start_line":2930,"start_character":0,"end_line":2937,"end_character":40},"in_reply_to":"3f79a3b5_8b57ef58","updated":"2018-08-10 21:29:59.000000000","message":"Done","commit_id":"2a10b87addae77e4a817a6a4bd712b017b25dd10"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c2bff876a818a39777fb6e7043f41aded7709864","unresolved":false,"context_lines":[{"line_number":2882,"context_line":"    # eventual results list"},{"line_number":2883,"context_line":"    for rc_id, amount in resources.items():"},{"line_number":2884,"context_line":"        rc_name \u003d _RC_CACHE.string_from_id(rc_id)"},{"line_number":2885,"context_line":"        provs_with_resource \u003d _get_providers_with_resource(ctx, rc_id, amount)"},{"line_number":2886,"context_line":"        rc_rp_ids \u003d set(p[0] for p in provs_with_resource)"},{"line_number":2887,"context_line":"        if filtered_rps:"},{"line_number":2888,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_f36d35cc","line":2885,"updated":"2018-08-10 22:02:02.000000000","message":"debug message after this, indicating how many providers satisfy only the resource part for just this one RC.","commit_id":"3ae57a5d8a561bbf5ed03a544863657cb2902ef6"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"f81d4714a59faab0a08449f81c23ab68f3a3331e","unresolved":false,"context_lines":[{"line_number":2882,"context_line":"    # eventual results list"},{"line_number":2883,"context_line":"    for rc_id, amount in resources.items():"},{"line_number":2884,"context_line":"        rc_name \u003d _RC_CACHE.string_from_id(rc_id)"},{"line_number":2885,"context_line":"        provs_with_resource \u003d _get_providers_with_resource(ctx, rc_id, amount)"},{"line_number":2886,"context_line":"        rc_rp_ids \u003d set(p[0] for p in provs_with_resource)"},{"line_number":2887,"context_line":"        if filtered_rps:"},{"line_number":2888,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_ae566f29","line":2885,"in_reply_to":"3f79a3b5_0712eb09","updated":"2018-08-12 13:02:25.000000000","message":"@Eric, that isn\u0027t enough, thinking about the case. We have total 10 rps, 5 rps has enough RC X, another 5 rps has enough RC Y.\n\nSo you will get message:\n\nFound 5 provides with enough available rc X\nFound 5 provides with enough available rc Y\n\nActually, 0 rps match all the requests, but that logs confuses that.","commit_id":"3ae57a5d8a561bbf5ed03a544863657cb2902ef6"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"879e34dca63dfcc70f846b9abcf71169b03e13dd","unresolved":false,"context_lines":[{"line_number":2882,"context_line":"    # eventual results list"},{"line_number":2883,"context_line":"    for rc_id, amount in resources.items():"},{"line_number":2884,"context_line":"        rc_name \u003d _RC_CACHE.string_from_id(rc_id)"},{"line_number":2885,"context_line":"        provs_with_resource \u003d _get_providers_with_resource(ctx, rc_id, amount)"},{"line_number":2886,"context_line":"        rc_rp_ids \u003d set(p[0] for p in provs_with_resource)"},{"line_number":2887,"context_line":"        if filtered_rps:"},{"line_number":2888,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_bad3fb5f","line":2885,"in_reply_to":"3f79a3b5_ae566f29","updated":"2018-08-13 13:11:59.000000000","message":"Actually, in that case you would see:\n\nFound 5 providers with enough available X\nAfter intersecting with the 100 results from agg/trait precalculation: 5\nAfter applying forbidden trait filters: 5\nFound 5 providers with enough available Y\nAfter intersecting with the 5 results from previous iteration: 0\n\n...which IMO makes plenty of sense.","commit_id":"3ae57a5d8a561bbf5ed03a544863657cb2902ef6"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"836d3e94c29e5b5c48f559d96fe42f4a192b793c","unresolved":false,"context_lines":[{"line_number":2882,"context_line":"    # eventual results list"},{"line_number":2883,"context_line":"    for rc_id, amount in resources.items():"},{"line_number":2884,"context_line":"        rc_name \u003d _RC_CACHE.string_from_id(rc_id)"},{"line_number":2885,"context_line":"        provs_with_resource \u003d _get_providers_with_resource(ctx, rc_id, amount)"},{"line_number":2886,"context_line":"        rc_rp_ids \u003d set(p[0] for p in provs_with_resource)"},{"line_number":2887,"context_line":"        if filtered_rps:"},{"line_number":2888,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_3acdab65","line":2885,"in_reply_to":"3f79a3b5_bad3fb5f","updated":"2018-08-13 13:25:25.000000000","message":"ah, I see now, yea, that makes sense, and that is useful for knowing we lose candidates after intersecting","commit_id":"3ae57a5d8a561bbf5ed03a544863657cb2902ef6"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"805a188364580de21ec5617e238255358c0d0e69","unresolved":false,"context_lines":[{"line_number":2882,"context_line":"    # eventual results list"},{"line_number":2883,"context_line":"    for rc_id, amount in resources.items():"},{"line_number":2884,"context_line":"        rc_name \u003d _RC_CACHE.string_from_id(rc_id)"},{"line_number":2885,"context_line":"        provs_with_resource \u003d _get_providers_with_resource(ctx, rc_id, amount)"},{"line_number":2886,"context_line":"        rc_rp_ids \u003d set(p[0] for p in provs_with_resource)"},{"line_number":2887,"context_line":"        if filtered_rps:"},{"line_number":2888,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_f3af757a","line":2885,"in_reply_to":"3f79a3b5_f36d35cc","updated":"2018-08-10 22:30:33.000000000","message":"That is done on line 2894. We want to iteratively show the number of filtered results after each filtering process, but here we haven\u0027t yet applied the filter -- we\u0027ve only determined how many providers of a particular resource class there are (not how many providers of a resource class there are that also match the traits + aggs)","commit_id":"3ae57a5d8a561bbf5ed03a544863657cb2902ef6"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5a7c6aea5392a6b82332711c36bc0910474fa0df","unresolved":false,"context_lines":[{"line_number":2882,"context_line":"    # eventual results list"},{"line_number":2883,"context_line":"    for rc_id, amount in resources.items():"},{"line_number":2884,"context_line":"        rc_name \u003d _RC_CACHE.string_from_id(rc_id)"},{"line_number":2885,"context_line":"        provs_with_resource \u003d _get_providers_with_resource(ctx, rc_id, amount)"},{"line_number":2886,"context_line":"        rc_rp_ids \u003d set(p[0] for p in provs_with_resource)"},{"line_number":2887,"context_line":"        if filtered_rps:"},{"line_number":2888,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_0712eb09","line":2885,"in_reply_to":"3f79a3b5_f3af757a","updated":"2018-08-11 13:27:24.000000000","message":"I\u0027m imagining a sequence of messages like this to be useful:\n\n- Found 10 providers with enough available resource of class X (L2885)\n- After intersecting with the 8 results from agg/trait precalculation and/or previous iteration (L2888) we\u0027re down to 6.\n- After applying forbidden trait filters, we\u0027re down to 4\n- Found 12 providers with enough available resource of class Y (L2885)\n- After intersecting with the 4 results from agg/trait precalculation and/or previous iteration (L2888) we\u0027re down to 4.\n- After applying forbidden trait filters, we\u0027re down to 4","commit_id":"3ae57a5d8a561bbf5ed03a544863657cb2902ef6"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c2bff876a818a39777fb6e7043f41aded7709864","unresolved":false,"context_lines":[{"line_number":2888,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2889,"context_line":"        else:"},{"line_number":2890,"context_line":"            filtered_rps \u003d rc_rp_ids"},{"line_number":2891,"context_line":"        if forbidden_traits and filtered_rps:"},{"line_number":2892,"context_line":"            filtered_rps -\u003d forbidden_rp_ids"},{"line_number":2893,"context_line":""},{"line_number":2894,"context_line":"        LOG.debug(\"found %d providers after applying resource filter (%s)\","},{"line_number":2895,"context_line":"                  len(filtered_rps), \"%s:%d\" % (rc_name, amount))"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_f31f7558","line":2892,"range":{"start_line":2891,"start_character":0,"end_line":2892,"end_character":44},"updated":"2018-08-10 22:02:02.000000000","message":"You should just be able to replace this with\n\n filtered_rps -\u003d forbidden_rp_ids\n\nwhich is a no-op if either is empty.","commit_id":"3ae57a5d8a561bbf5ed03a544863657cb2902ef6"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"805a188364580de21ec5617e238255358c0d0e69","unresolved":false,"context_lines":[{"line_number":2888,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2889,"context_line":"        else:"},{"line_number":2890,"context_line":"            filtered_rps \u003d rc_rp_ids"},{"line_number":2891,"context_line":"        if forbidden_traits and filtered_rps:"},{"line_number":2892,"context_line":"            filtered_rps -\u003d forbidden_rp_ids"},{"line_number":2893,"context_line":""},{"line_number":2894,"context_line":"        LOG.debug(\"found %d providers after applying resource filter (%s)\","},{"line_number":2895,"context_line":"                  len(filtered_rps), \"%s:%d\" % (rc_name, amount))"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_139c715b","line":2892,"range":{"start_line":2891,"start_character":0,"end_line":2892,"end_character":44},"in_reply_to":"3f79a3b5_f31f7558","updated":"2018-08-10 22:30:33.000000000","message":"ok. it\u0027s the same number of lines of code (since I would need to initialize forbidden_rp_ids to a set()).","commit_id":"3ae57a5d8a561bbf5ed03a544863657cb2902ef6"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c2bff876a818a39777fb6e7043f41aded7709864","unresolved":false,"context_lines":[{"line_number":2891,"context_line":"        if forbidden_traits and filtered_rps:"},{"line_number":2892,"context_line":"            filtered_rps -\u003d forbidden_rp_ids"},{"line_number":2893,"context_line":""},{"line_number":2894,"context_line":"        LOG.debug(\"found %d providers after applying resource filter (%s)\","},{"line_number":2895,"context_line":"                  len(filtered_rps), \"%s:%d\" % (rc_name, amount))"},{"line_number":2896,"context_line":"        if not filtered_rps:"},{"line_number":2897,"context_line":"            return []"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_538bc96c","line":2894,"range":{"start_line":2894,"start_character":53,"end_line":2894,"end_character":68},"updated":"2018-08-10 22:02:02.000000000","message":"(previous resource and) trait/aggregate filters","commit_id":"3ae57a5d8a561bbf5ed03a544863657cb2902ef6"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5a7c6aea5392a6b82332711c36bc0910474fa0df","unresolved":false,"context_lines":[{"line_number":2891,"context_line":"        if forbidden_traits and filtered_rps:"},{"line_number":2892,"context_line":"            filtered_rps -\u003d forbidden_rp_ids"},{"line_number":2893,"context_line":""},{"line_number":2894,"context_line":"        LOG.debug(\"found %d providers after applying resource filter (%s)\","},{"line_number":2895,"context_line":"                  len(filtered_rps), \"%s:%d\" % (rc_name, amount))"},{"line_number":2896,"context_line":"        if not filtered_rps:"},{"line_number":2897,"context_line":"            return []"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_c7f713d3","line":2894,"range":{"start_line":2894,"start_character":53,"end_line":2894,"end_character":68},"in_reply_to":"3f79a3b5_33df2d0e","updated":"2018-08-11 13:27:24.000000000","message":"Right, and I\u0027m trying to say overall that we should have more messages than that. See fup on L2885.","commit_id":"3ae57a5d8a561bbf5ed03a544863657cb2902ef6"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"805a188364580de21ec5617e238255358c0d0e69","unresolved":false,"context_lines":[{"line_number":2891,"context_line":"        if forbidden_traits and filtered_rps:"},{"line_number":2892,"context_line":"            filtered_rps -\u003d forbidden_rp_ids"},{"line_number":2893,"context_line":""},{"line_number":2894,"context_line":"        LOG.debug(\"found %d providers after applying resource filter (%s)\","},{"line_number":2895,"context_line":"                  len(filtered_rps), \"%s:%d\" % (rc_name, amount))"},{"line_number":2896,"context_line":"        if not filtered_rps:"},{"line_number":2897,"context_line":"            return []"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_33df2d0e","line":2894,"range":{"start_line":2894,"start_character":53,"end_line":2894,"end_character":68},"in_reply_to":"3f79a3b5_538bc96c","updated":"2018-08-10 22:30:33.000000000","message":"No, I\u0027m trying to be consistent in the DEBUG messages that get output. The message always comes after applying one iteration of filter:\n\n- after required traits\n- after required agg associations\n- after forbidden traits\n- after each resource class","commit_id":"3ae57a5d8a561bbf5ed03a544863657cb2902ef6"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c2bff876a818a39777fb6e7043f41aded7709864","unresolved":false,"context_lines":[{"line_number":2900,"context_line":"    # our filtered_rps set. We return the list of tuples of (internal provider"},{"line_number":2901,"context_line":"    # ID, root internal provider ID)"},{"line_number":2902,"context_line":"    matching_rps \u003d []"},{"line_number":2903,"context_line":"    for prov_ids in provs_with_resource:"},{"line_number":2904,"context_line":"        if prov_ids[0] in filtered_rps:"},{"line_number":2905,"context_line":"            matching_rps.append(prov_ids)"},{"line_number":2906,"context_line":"    return matching_rps"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_b3b01d45","line":2903,"range":{"start_line":2903,"start_character":20,"end_line":2903,"end_character":39},"updated":"2018-08-10 22:02:02.000000000","message":"pretty sure we can\u0027t get here if resources was empty, but my IDE will be happier if this is initialized to set() before the loop.","commit_id":"3ae57a5d8a561bbf5ed03a544863657cb2902ef6"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"805a188364580de21ec5617e238255358c0d0e69","unresolved":false,"context_lines":[{"line_number":2900,"context_line":"    # our filtered_rps set. We return the list of tuples of (internal provider"},{"line_number":2901,"context_line":"    # ID, root internal provider ID)"},{"line_number":2902,"context_line":"    matching_rps \u003d []"},{"line_number":2903,"context_line":"    for prov_ids in provs_with_resource:"},{"line_number":2904,"context_line":"        if prov_ids[0] in filtered_rps:"},{"line_number":2905,"context_line":"            matching_rps.append(prov_ids)"},{"line_number":2906,"context_line":"    return matching_rps"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_53e429e1","line":2903,"range":{"start_line":2903,"start_character":20,"end_line":2903,"end_character":39},"in_reply_to":"3f79a3b5_b3b01d45","updated":"2018-08-10 22:30:33.000000000","message":"Done","commit_id":"3ae57a5d8a561bbf5ed03a544863657cb2902ef6"},{"author":{"_account_id":27336,"name":"XiaojueGuan","email":"xiaojueguan@gmail.com","username":"XiaojueGuan"},"change_message_id":"3c6a24e340a9410886544ec7db2c99ec4af56f0e","unresolved":false,"context_lines":[{"line_number":826,"context_line":"    sel \u003d sa.select([rp_tbl.c.id]).select_from(join_chain)"},{"line_number":827,"context_line":"    if rp_ids:"},{"line_number":828,"context_line":"        sel \u003d sel.where(rp_tbl.c.id.in_(rp_ids))"},{"line_number":829,"context_line":"    return set(r[0] for r in context.session.execute(sel))"},{"line_number":830,"context_line":""},{"line_number":831,"context_line":""},{"line_number":832,"context_line":"@db_api.placement_context_manager.writer"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_2e381fec","line":829,"range":{"start_line":829,"start_character":11,"end_line":829,"end_character":14},"updated":"2018-08-12 13:04:49.000000000","message":"what\u0027s the difference between a list and a set","commit_id":"f4ed285c029e8d7da4ebfdaa8344225e18fc6d87"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"879e34dca63dfcc70f846b9abcf71169b03e13dd","unresolved":false,"context_lines":[{"line_number":826,"context_line":"    sel \u003d sa.select([rp_tbl.c.id]).select_from(join_chain)"},{"line_number":827,"context_line":"    if rp_ids:"},{"line_number":828,"context_line":"        sel \u003d sel.where(rp_tbl.c.id.in_(rp_ids))"},{"line_number":829,"context_line":"    return set(r[0] for r in context.session.execute(sel))"},{"line_number":830,"context_line":""},{"line_number":831,"context_line":""},{"line_number":832,"context_line":"@db_api.placement_context_manager.writer"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_fa8e5377","line":829,"range":{"start_line":829,"start_character":11,"end_line":829,"end_character":14},"in_reply_to":"3f79a3b5_2e381fec","updated":"2018-08-13 13:11:59.000000000","message":"A set can only have a given element once, whereas a list can repeat elements. Think of a set as a hash with only keys, no values (because that\u0027s how Python thinks of it internally). Lists have an order; sets do not. Sets have O(1) lookup; lists have O(N).\n\nIf you\u0027re asking why this is being changed, it\u0027s because we\u0027re doing a lot of set operations (intersections and subtractions) in the rewritten algorithm below, so it makes sense to start off with sets rather than lists.","commit_id":"f4ed285c029e8d7da4ebfdaa8344225e18fc6d87"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"e761eec3e83cab1c66826af6ae94be40d4892597","unresolved":false,"context_lines":[{"line_number":2861,"context_line":"    if forbidden_traits:"},{"line_number":2862,"context_line":"        forbidden_rp_ids \u003d _get_provider_ids_having_any_trait("},{"line_number":2863,"context_line":"            ctx, forbidden_traits)"},{"line_number":2864,"context_line":"        if filtered_rps:"},{"line_number":2865,"context_line":"            filtered_rps -\u003d forbidden_rp_ids"},{"line_number":2866,"context_line":"            LOG.debug(\"found %d providers after applying forbidden traits \""},{"line_number":2867,"context_line":"                      \"filter (%s)\", len(filtered_rps), forbidden_traits)"},{"line_number":2868,"context_line":"            if not filtered_rps:"},{"line_number":2869,"context_line":"                return []"},{"line_number":2870,"context_line":""},{"line_number":2871,"context_line":"    # Instead of constructing a giant complex SQL statement that joins multiple"},{"line_number":2872,"context_line":"    # copies of derived usage tables and inventory tables to each other, we do"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_ac3d1ec5","line":2869,"range":{"start_line":2864,"start_character":0,"end_line":2869,"end_character":25},"updated":"2018-08-11 07:44:58.000000000","message":"This seems to be redundant with L2893, and L2893 doesn\u0027t show any debug messages now. Let\u0027s not operate forbidden traits here and move this to the last filtering?","commit_id":"f4ed285c029e8d7da4ebfdaa8344225e18fc6d87"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5a7c6aea5392a6b82332711c36bc0910474fa0df","unresolved":false,"context_lines":[{"line_number":2861,"context_line":"    if forbidden_traits:"},{"line_number":2862,"context_line":"        forbidden_rp_ids \u003d _get_provider_ids_having_any_trait("},{"line_number":2863,"context_line":"            ctx, forbidden_traits)"},{"line_number":2864,"context_line":"        if filtered_rps:"},{"line_number":2865,"context_line":"            filtered_rps -\u003d forbidden_rp_ids"},{"line_number":2866,"context_line":"            LOG.debug(\"found %d providers after applying forbidden traits \""},{"line_number":2867,"context_line":"                      \"filter (%s)\", len(filtered_rps), forbidden_traits)"},{"line_number":2868,"context_line":"            if not filtered_rps:"},{"line_number":2869,"context_line":"                return []"},{"line_number":2870,"context_line":""},{"line_number":2871,"context_line":"    # Instead of constructing a giant complex SQL statement that joins multiple"},{"line_number":2872,"context_line":"    # copies of derived usage tables and inventory tables to each other, we do"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_874fdb32","line":2869,"range":{"start_line":2864,"start_character":0,"end_line":2869,"end_character":25},"in_reply_to":"3f79a3b5_ac3d1ec5","updated":"2018-08-11 13:27:24.000000000","message":"Not quite. This one is finishing predetermining the providers that match aggregates and required/forbidden traits. We start with that pared-down list as a baseline for filtering out providers that have enough resource.\n\nWe need 2893 separately because filtered_rps might not have been initialized when we run this chunk (the branch in L2864 would be skipped) if we had no aggs or required traits.","commit_id":"f4ed285c029e8d7da4ebfdaa8344225e18fc6d87"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"702cea788cbb2f5f85b72537c084608f9bc8d2bc","unresolved":false,"context_lines":[{"line_number":2876,"context_line":"    # well as reduce the necessary knowledge of SQL in order to understand the"},{"line_number":2877,"context_line":"    # queries being executed here."},{"line_number":2878,"context_line":"    #"},{"line_number":2879,"context_line":"    # NOTE(jaypipes): The efficiency of this operation may be improved by"},{"line_number":2880,"context_line":"    # passing the trait_rps and/or forbidden_ip_ids iterables to the"},{"line_number":2881,"context_line":"    # _get_providers_with_resource() function so that we don\u0027t have to process"},{"line_number":2882,"context_line":"    # as many records inside the loop below to remove providers from the"},{"line_number":2883,"context_line":"    # eventual results list"},{"line_number":2884,"context_line":"    provs_with_resource \u003d []"},{"line_number":2885,"context_line":"    for rc_id, amount in resources.items():"},{"line_number":2886,"context_line":"        rc_name \u003d _RC_CACHE.string_from_id(rc_id)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_ce7acbb8","line":2883,"range":{"start_line":2879,"start_character":4,"end_line":2883,"end_character":27},"updated":"2018-08-12 12:53:05.000000000","message":"And _get_providers_with_resources return {rp_id, (rp_id, root_rp_id)} sounds more efficient also. Then we needn\u0027t create another set in line 2888, and reduce the loopsin line 2904","commit_id":"f4ed285c029e8d7da4ebfdaa8344225e18fc6d87"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"879e34dca63dfcc70f846b9abcf71169b03e13dd","unresolved":false,"context_lines":[{"line_number":2876,"context_line":"    # well as reduce the necessary knowledge of SQL in order to understand the"},{"line_number":2877,"context_line":"    # queries being executed here."},{"line_number":2878,"context_line":"    #"},{"line_number":2879,"context_line":"    # NOTE(jaypipes): The efficiency of this operation may be improved by"},{"line_number":2880,"context_line":"    # passing the trait_rps and/or forbidden_ip_ids iterables to the"},{"line_number":2881,"context_line":"    # _get_providers_with_resource() function so that we don\u0027t have to process"},{"line_number":2882,"context_line":"    # as many records inside the loop below to remove providers from the"},{"line_number":2883,"context_line":"    # eventual results list"},{"line_number":2884,"context_line":"    provs_with_resource \u003d []"},{"line_number":2885,"context_line":"    for rc_id, amount in resources.items():"},{"line_number":2886,"context_line":"        rc_name \u003d _RC_CACHE.string_from_id(rc_id)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_daefd71b","line":2883,"range":{"start_line":2879,"start_character":4,"end_line":2883,"end_character":27},"in_reply_to":"3f79a3b5_ce7acbb8","updated":"2018-08-13 13:11:59.000000000","message":"+1","commit_id":"f4ed285c029e8d7da4ebfdaa8344225e18fc6d87"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"693b257bbf2e698f000262960895c42cc661683b","unresolved":false,"context_lines":[{"line_number":2876,"context_line":"    # well as reduce the necessary knowledge of SQL in order to understand the"},{"line_number":2877,"context_line":"    # queries being executed here."},{"line_number":2878,"context_line":"    #"},{"line_number":2879,"context_line":"    # NOTE(jaypipes): The efficiency of this operation may be improved by"},{"line_number":2880,"context_line":"    # passing the trait_rps and/or forbidden_ip_ids iterables to the"},{"line_number":2881,"context_line":"    # _get_providers_with_resource() function so that we don\u0027t have to process"},{"line_number":2882,"context_line":"    # as many records inside the loop below to remove providers from the"},{"line_number":2883,"context_line":"    # eventual results list"},{"line_number":2884,"context_line":"    provs_with_resource \u003d []"},{"line_number":2885,"context_line":"    for rc_id, amount in resources.items():"},{"line_number":2886,"context_line":"        rc_name \u003d _RC_CACHE.string_from_id(rc_id)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_1ac46f5e","line":2883,"range":{"start_line":2879,"start_character":4,"end_line":2883,"end_character":27},"in_reply_to":"3f79a3b5_daefd71b","updated":"2018-08-13 13:24:55.000000000","message":"I\u0027m not going to change the return type of the _get_providers_with_resource() function in this patch. It is called from more places than just here. I can do that in a followup patch.","commit_id":"f4ed285c029e8d7da4ebfdaa8344225e18fc6d87"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"e761eec3e83cab1c66826af6ae94be40d4892597","unresolved":false,"context_lines":[{"line_number":2890,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2891,"context_line":"        else:"},{"line_number":2892,"context_line":"            filtered_rps \u003d rc_rp_ids"},{"line_number":2893,"context_line":"        filtered_rps -\u003d forbidden_rp_ids"},{"line_number":2894,"context_line":""},{"line_number":2895,"context_line":"        LOG.debug(\"found %d providers after applying resource filter (%s)\","},{"line_number":2896,"context_line":"                  len(filtered_rps), \"%s:%d\" % (rc_name, amount))"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_8c3062ea","line":2893,"range":{"start_line":2893,"start_character":8,"end_line":2893,"end_character":40},"updated":"2018-08-11 07:44:58.000000000","message":"We have no debug message here. Why not move this after L2898 and have a debug message there?","commit_id":"f4ed285c029e8d7da4ebfdaa8344225e18fc6d87"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"8624c647f0e4d3d62c76910ab7495589606c0ee0","unresolved":false,"context_lines":[{"line_number":2890,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2891,"context_line":"        else:"},{"line_number":2892,"context_line":"            filtered_rps \u003d rc_rp_ids"},{"line_number":2893,"context_line":"        filtered_rps -\u003d forbidden_rp_ids"},{"line_number":2894,"context_line":""},{"line_number":2895,"context_line":"        LOG.debug(\"found %d providers after applying resource filter (%s)\","},{"line_number":2896,"context_line":"                  len(filtered_rps), \"%s:%d\" % (rc_name, amount))"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_e4fa3141","line":2893,"range":{"start_line":2893,"start_character":8,"end_line":2893,"end_character":40},"in_reply_to":"3f79a3b5_640ce1eb","updated":"2018-08-13 19:47:34.000000000","message":"right. only on the first iteration.","commit_id":"f4ed285c029e8d7da4ebfdaa8344225e18fc6d87"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"702cea788cbb2f5f85b72537c084608f9bc8d2bc","unresolved":false,"context_lines":[{"line_number":2890,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2891,"context_line":"        else:"},{"line_number":2892,"context_line":"            filtered_rps \u003d rc_rp_ids"},{"line_number":2893,"context_line":"        filtered_rps -\u003d forbidden_rp_ids"},{"line_number":2894,"context_line":""},{"line_number":2895,"context_line":"        LOG.debug(\"found %d providers after applying resource filter (%s)\","},{"line_number":2896,"context_line":"                  len(filtered_rps), \"%s:%d\" % (rc_name, amount))"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_ae7d0fb3","line":2893,"range":{"start_line":2893,"start_character":8,"end_line":2893,"end_character":40},"in_reply_to":"3f79a3b5_67007fac","updated":"2018-08-12 12:53:05.000000000","message":"Because the previous log message, already show some of rps striping out of the results, so the log message in line 2895 also needs to strip out those rps with forbidden trait. That is what i understand","commit_id":"f4ed285c029e8d7da4ebfdaa8344225e18fc6d87"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"693b257bbf2e698f000262960895c42cc661683b","unresolved":false,"context_lines":[{"line_number":2890,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2891,"context_line":"        else:"},{"line_number":2892,"context_line":"            filtered_rps \u003d rc_rp_ids"},{"line_number":2893,"context_line":"        filtered_rps -\u003d forbidden_rp_ids"},{"line_number":2894,"context_line":""},{"line_number":2895,"context_line":"        LOG.debug(\"found %d providers after applying resource filter (%s)\","},{"line_number":2896,"context_line":"                  len(filtered_rps), \"%s:%d\" % (rc_name, amount))"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_bab9bbcc","line":2893,"range":{"start_line":2893,"start_character":8,"end_line":2893,"end_character":40},"in_reply_to":"3f79a3b5_67007fac","updated":"2018-08-13 13:24:55.000000000","message":"This filter needs to be executed on each iteration. Imagine the following: 5 providers match VCPU however 2 of those providers are in the forbidden_rp_ids set. If we don\u0027t execute the set subtraction here on each iteration, those 2 providers will not be properly removed from the matching set.","commit_id":"f4ed285c029e8d7da4ebfdaa8344225e18fc6d87"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"37a9b8888039eda57be81080aa9fbc5332875682","unresolved":false,"context_lines":[{"line_number":2890,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2891,"context_line":"        else:"},{"line_number":2892,"context_line":"            filtered_rps \u003d rc_rp_ids"},{"line_number":2893,"context_line":"        filtered_rps -\u003d forbidden_rp_ids"},{"line_number":2894,"context_line":""},{"line_number":2895,"context_line":"        LOG.debug(\"found %d providers after applying resource filter (%s)\","},{"line_number":2896,"context_line":"                  len(filtered_rps), \"%s:%d\" % (rc_name, amount))"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_640ce1eb","line":2893,"range":{"start_line":2893,"start_character":8,"end_line":2893,"end_character":40},"in_reply_to":"3f79a3b5_89591b36","updated":"2018-08-13 19:36:51.000000000","message":"Only on the first iteration.\n\n[1, 2, 3, 4] have VCPU capacity. Forbidden traits cause 2 to be removed. filtered_rps is now [1, 3, 4].\n\n[2, 3, 4, 5] have MEMORY_MB capacity. Let\u0027s say 5 has a forbidden trait. L2890 does:\n\n filtered_rps \u003d [1, 3, 4] \u0026 [2, 3, 4, 5] \u003d [1, 3, 4]\n\nSo L2893 is a no-op on the second (and each subsequent) iteration.","commit_id":"f4ed285c029e8d7da4ebfdaa8344225e18fc6d87"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5a7c6aea5392a6b82332711c36bc0910474fa0df","unresolved":false,"context_lines":[{"line_number":2890,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2891,"context_line":"        else:"},{"line_number":2892,"context_line":"            filtered_rps \u003d rc_rp_ids"},{"line_number":2893,"context_line":"        filtered_rps -\u003d forbidden_rp_ids"},{"line_number":2894,"context_line":""},{"line_number":2895,"context_line":"        LOG.debug(\"found %d providers after applying resource filter (%s)\","},{"line_number":2896,"context_line":"                  len(filtered_rps), \"%s:%d\" % (rc_name, amount))"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_67007fac","line":2893,"range":{"start_line":2893,"start_character":8,"end_line":2893,"end_character":40},"in_reply_to":"3f79a3b5_8c3062ea","updated":"2018-08-11 13:27:24.000000000","message":"Agree - see fups in PS10.\n\nIt also occurs to me that this filter will only ever have an effect on the first iteration. (Not sure if that\u0027s what Tetsuro is saying above.) Wondering if there\u0027s a way to break it out so we only do it (and log about it) once.","commit_id":"f4ed285c029e8d7da4ebfdaa8344225e18fc6d87"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"569e6214c1aa18650d5ecc3bd562dd253643d823","unresolved":false,"context_lines":[{"line_number":2890,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2891,"context_line":"        else:"},{"line_number":2892,"context_line":"            filtered_rps \u003d rc_rp_ids"},{"line_number":2893,"context_line":"        filtered_rps -\u003d forbidden_rp_ids"},{"line_number":2894,"context_line":""},{"line_number":2895,"context_line":"        LOG.debug(\"found %d providers after applying resource filter (%s)\","},{"line_number":2896,"context_line":"                  len(filtered_rps), \"%s:%d\" % (rc_name, amount))"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_eefa1541","line":2893,"range":{"start_line":2893,"start_character":8,"end_line":2893,"end_character":40},"in_reply_to":"3f79a3b5_bab9bbcc","updated":"2018-08-13 16:07:57.000000000","message":"Nope, because any providers with the forbidden traits would already have been filtered out of the (bigger) set on the first iteration, so they\u0027ll be removed by the intersection on L2890.\n\nThis is not a blocker for this patch.\n\n(However, if we reorganize the code to allow for clearer debug messages, it may end up lending itself to different logic on the first vs. subsequent iterations anyway.)","commit_id":"f4ed285c029e8d7da4ebfdaa8344225e18fc6d87"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"1672b48c9a533093fa03be03a7ab881df4f17fa2","unresolved":false,"context_lines":[{"line_number":2890,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2891,"context_line":"        else:"},{"line_number":2892,"context_line":"            filtered_rps \u003d rc_rp_ids"},{"line_number":2893,"context_line":"        filtered_rps -\u003d forbidden_rp_ids"},{"line_number":2894,"context_line":""},{"line_number":2895,"context_line":"        LOG.debug(\"found %d providers after applying resource filter (%s)\","},{"line_number":2896,"context_line":"                  len(filtered_rps), \"%s:%d\" % (rc_name, amount))"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_89591b36","line":2893,"range":{"start_line":2893,"start_character":8,"end_line":2893,"end_character":40},"in_reply_to":"3f79a3b5_eefa1541","updated":"2018-08-13 16:15:55.000000000","message":"If there were no required traits, and only forbidden traits, we still need to execute the forbidden_rp_ids set subtraction (on each iteration).\n\nAssume no required traits. Assume forbidden traits are specified.\n\nIf I get a set of [1, 2, 3, 4] that have VCPU capacity, I still need to apply the forbidden_rp_ids set in order to prevent any of [1, 2, 3, 4] that are in forbidden_rp_ids from being included in the end result.","commit_id":"f4ed285c029e8d7da4ebfdaa8344225e18fc6d87"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"d2d66c7d6ff5c8a90af41530f64a483c14685bc5","unresolved":false,"context_lines":[{"line_number":2898,"context_line":"            first \u003d False"},{"line_number":2899,"context_line":"            if filtered_rps:"},{"line_number":2900,"context_line":"                filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2901,"context_line":"                LOG.debug(\"      %d after applying initial aggregate and \""},{"line_number":2902,"context_line":"                          \"trait filters\", len(filtered_rps))"},{"line_number":2903,"context_line":"            else:"},{"line_number":2904,"context_line":"                filtered_rps \u003d rc_rp_ids"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_e7a0e192","line":2901,"updated":"2018-08-14 15:51:17.000000000","message":"I like the indenting, but it\u0027s only useful if someone has already grepped the log by request id to filter out noise from other requests.\n\nWhich they would need to do whatever the formatting, so cool.","commit_id":"4a93b316b9556df1a577d4da47765970daa95abd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"21a7663d3eda3039996601a196f2a235e2508f78","unresolved":false,"context_lines":[{"line_number":2840,"context_line":"        filtered_rps \u003d trait_rps"},{"line_number":2841,"context_line":"        LOG.debug(\"found %d providers after applying required traits filter \""},{"line_number":2842,"context_line":"                  \"(%s)\","},{"line_number":2843,"context_line":"                  len(filtered_rps), len(required_traits.keys()))"},{"line_number":2844,"context_line":"        if not filtered_rps:"},{"line_number":2845,"context_line":"            return []"},{"line_number":2846,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3f79a3b5_33436644","line":2843,"range":{"start_line":2843,"start_character":37,"end_line":2843,"end_character":40},"updated":"2018-08-15 13:28:12.000000000","message":"list\n\nalso .keys() is redundant.","commit_id":"06dce35b47b7c6b68ccbc107a3c73fbadbb84832"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"464da7746ea265c75af41ee859659a874e972535","unresolved":false,"context_lines":[{"line_number":2918,"context_line":"                              len(filtered_rps))"},{"line_number":2919,"context_line":"        else:"},{"line_number":2920,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2921,"context_line":"            LOG.debug(\"      %d after filtering by previous result\","},{"line_number":2922,"context_line":"                      len(filtered_rps))"},{"line_number":2923,"context_line":""},{"line_number":2924,"context_line":"        if not filtered_rps:"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_ba769ba3","line":2921,"updated":"2018-08-23 21:47:16.000000000","message":"What does this line mean? Was just perusing the output [1] and it wasn\u0027t clear to me what this means: \"1 after filtering by previous result\", it doesn\u0027t seem like a complete sentence?\n\n[1] http://logs.openstack.org/41/590041/15/check/tempest-full/31d873e/controller/logs/screen-placement-api.txt.gz#_Aug_15_14_10_01_961834","commit_id":"292b995d73bb84609a66f0491c563b7c04f7ae96"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"aca6f484be6e2cf774c28a1cb552faf83ecf4e56","unresolved":false,"context_lines":[{"line_number":2918,"context_line":"                              len(filtered_rps))"},{"line_number":2919,"context_line":"        else:"},{"line_number":2920,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2921,"context_line":"            LOG.debug(\"      %d after filtering by previous result\","},{"line_number":2922,"context_line":"                      len(filtered_rps))"},{"line_number":2923,"context_line":""},{"line_number":2924,"context_line":"        if not filtered_rps:"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_d50c76ed","line":2921,"in_reply_to":"3f79a3b5_1265241e","updated":"2018-08-24 15:35:15.000000000","message":"@melwitt has a good point here. If it\u0027s unclear, we should change it. The original log messages had an indication of where we were in the resources loop by indicating in each log line which resource class and requested amount we were currently attempting to filter:\n\nhttps://review.openstack.org/#/c/590041/1/nova/api/openstack/placement/objects/resource_provider.py@2870\n\nPerhaps it\u0027s worth adding something like that back in?","commit_id":"292b995d73bb84609a66f0491c563b7c04f7ae96"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"cb4ad5896e330c39c14e10bfc4c08ae8f7c2366f","unresolved":false,"context_lines":[{"line_number":2918,"context_line":"                              len(filtered_rps))"},{"line_number":2919,"context_line":"        else:"},{"line_number":2920,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2921,"context_line":"            LOG.debug(\"      %d after filtering by previous result\","},{"line_number":2922,"context_line":"                      len(filtered_rps))"},{"line_number":2923,"context_line":""},{"line_number":2924,"context_line":"        if not filtered_rps:"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_d532365e","line":2921,"in_reply_to":"3f79a3b5_1265241e","updated":"2018-08-24 15:44:21.000000000","message":"I think you\u0027re right and it\u0027s supposed to be \"found N providers with available RESOURCE, M after filtering by previous result\"\n\nI wonder if it would make more sense to build up the error message as a full sentence and then emit it all at once?","commit_id":"292b995d73bb84609a66f0491c563b7c04f7ae96"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"15d70ccdd8c57578d53db2720264b9ced486bfae","unresolved":false,"context_lines":[{"line_number":2918,"context_line":"                              len(filtered_rps))"},{"line_number":2919,"context_line":"        else:"},{"line_number":2920,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2921,"context_line":"            LOG.debug(\"      %d after filtering by previous result\","},{"line_number":2922,"context_line":"                      len(filtered_rps))"},{"line_number":2923,"context_line":""},{"line_number":2924,"context_line":"        if not filtered_rps:"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_1265241e","line":2921,"in_reply_to":"3f79a3b5_327b808c","updated":"2018-08-24 15:21:03.000000000","message":"Well, what I mean is, a sentence starting with a number doesn\u0027t make a lot of sense to me and it doesn\u0027t even seem to connect with the previously logged sentences. Is it supposed to be, \"found N providers with available RESOURCE, M after filtering by previous result\"? \n\nSo the verb here should be \"found\" and the noun is \"providers\", sounds like. Found N providers after filtering by previous result.\n\nSorry, not trying to cause a problem here, just genuinely didn\u0027t understand these \"\u003cnumber\u003e after\" sentences. If it\u0027s only me who doesn\u0027t understand this, don\u0027t hold up on my account. :)","commit_id":"292b995d73bb84609a66f0491c563b7c04f7ae96"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"bd21c40c8407f24d8a97cb7c94030e5f53137faa","unresolved":false,"context_lines":[{"line_number":2918,"context_line":"                              len(filtered_rps))"},{"line_number":2919,"context_line":"        else:"},{"line_number":2920,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2921,"context_line":"            LOG.debug(\"      %d after filtering by previous result\","},{"line_number":2922,"context_line":"                      len(filtered_rps))"},{"line_number":2923,"context_line":""},{"line_number":2924,"context_line":"        if not filtered_rps:"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_56c389ed","line":2921,"in_reply_to":"3f79a3b5_769c8569","updated":"2018-08-24 19:25:58.000000000","message":"Done, now all the messages have the same shape.\n\nMy problem with this, btw, and the reason we were using the \"indent\" before, was so you could distinguish one request group from another. Which wasn\u0027t perfect in the last PS anyway, so meh.","commit_id":"292b995d73bb84609a66f0491c563b7c04f7ae96"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"cdcf26ab8d6656beadba6546b39da0efb13acdd0","unresolved":false,"context_lines":[{"line_number":2918,"context_line":"                              len(filtered_rps))"},{"line_number":2919,"context_line":"        else:"},{"line_number":2920,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2921,"context_line":"            LOG.debug(\"      %d after filtering by previous result\","},{"line_number":2922,"context_line":"                      len(filtered_rps))"},{"line_number":2923,"context_line":""},{"line_number":2924,"context_line":"        if not filtered_rps:"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_ddd7d14a","line":2921,"in_reply_to":"3f79a3b5_ba769ba3","updated":"2018-08-23 22:57:41.000000000","message":"In the logs I think you need to combine it with the two previous log entries.\n\nfound x providers with available \u003cresource A\u003e\nfound y providers with available \u003cresource B\u003e\nz after filtering by previous result\n\n\nI *think* that logically the third log is a continuation of the second.  It means that there are z providers that have both resource A and resource B available.  (Where presumably z is less than or equal to each of x and y.)\n\nI agree the wording is a bit confusing, especially for the third log.","commit_id":"292b995d73bb84609a66f0491c563b7c04f7ae96"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8a6c5f02f14d45b37d6131cda28504892c14160b","unresolved":false,"context_lines":[{"line_number":2918,"context_line":"                              len(filtered_rps))"},{"line_number":2919,"context_line":"        else:"},{"line_number":2920,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2921,"context_line":"            LOG.debug(\"      %d after filtering by previous result\","},{"line_number":2922,"context_line":"                      len(filtered_rps))"},{"line_number":2923,"context_line":""},{"line_number":2924,"context_line":"        if not filtered_rps:"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_769c8569","line":2921,"in_reply_to":"3f79a3b5_d532365e","updated":"2018-08-24 19:14:37.000000000","message":"\u003e In the logs I think you need to combine it with the two previous\n \u003e log entries.\n\nThis. The indent is intended to let you line them up visually.\n\nhttp://logs.openstack.org/41/590041/15/check/tempest-full/31d873e/controller/logs/screen-placement-api.txt.gz#_Aug_15_14_10_01_954855\n\n \u003e indication of where we were in the resources loop\n\nDig, but the log should first and foremost be readable to the operator without having to understand it in the context of the source code.\n\n \u003e I think you\u0027re right and it\u0027s supposed to be \"found N providers\n \u003e with available RESOURCE, M after filtering by previous result\"\n\nNoting of course that N and M will sometimes (even often) be the same.\n\n \u003e I wonder if it would make more sense to build up the error message\n \u003e as a full sentence and then emit it all at once?\n\nThat\u0027s an idea. Though realistically the reader is going to be looking at the sequence of messages (for a given req id) all together, not just one message in isolation, so I\u0027m not sure it\u0027s necessary.\n\nIncluding \u0027found\u0027 in the message would probably be the simplest thing right now, and we can iterate on it in subsequent patches. Thoughts?","commit_id":"292b995d73bb84609a66f0491c563b7c04f7ae96"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"55335ce2924ea2ced66d73b79ab811ff023f55e1","unresolved":false,"context_lines":[{"line_number":2918,"context_line":"                              len(filtered_rps))"},{"line_number":2919,"context_line":"        else:"},{"line_number":2920,"context_line":"            filtered_rps \u0026\u003d rc_rp_ids"},{"line_number":2921,"context_line":"            LOG.debug(\"      %d after filtering by previous result\","},{"line_number":2922,"context_line":"                      len(filtered_rps))"},{"line_number":2923,"context_line":""},{"line_number":2924,"context_line":"        if not filtered_rps:"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_327b808c","line":2921,"in_reply_to":"3f79a3b5_ddd7d14a","updated":"2018-08-24 15:05:58.000000000","message":"maybe: \"    %d after combining the previous results\"","commit_id":"292b995d73bb84609a66f0491c563b7c04f7ae96"}]}
