)]}'
{"nova/compute/resource_tracker.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"cacbb613c85f168306e991207ab3767a5990f626","unresolved":false,"context_lines":[{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        if self.pci_tracker:"},{"line_number":218,"context_line":"            if pci_requests:"},{"line_number":219,"context_line":"                tags \u003d instance.flavor.extra_specs.get(\u0027pci_distinct_tags\u0027, \u0027\u0027)"},{"line_number":220,"context_line":"                pci_requests.distinct_tags \u003d ["},{"line_number":221,"context_line":"                    s.strip() for s in tags.split(\u0027,\u0027)]"},{"line_number":222,"context_line":"            # NOTE(jaypipes): ComputeNode.pci_device_pools is set below"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_47f5e7ca","line":219,"range":{"start_line":219,"start_character":56,"end_line":219,"end_character":73},"updated":"2017-07-12 20:45:30.000000000","message":"Should \u0027distinct\u0027\u003d\u003e\u0027unique\u0027 to match the conf option?\n\nBTW, where\u0027s the conf option defined?  Another change set?","commit_id":"6037963e2cfc7bd85023beff05365f2672eabbc8"},{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"3151f93da017c74be92708c5017b1f51ab6cc7fa","unresolved":false,"context_lines":[{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        if self.pci_tracker:"},{"line_number":218,"context_line":"            if pci_requests:"},{"line_number":219,"context_line":"                tags \u003d instance.flavor.extra_specs.get(\u0027pci_distinct_tags\u0027, \u0027\u0027)"},{"line_number":220,"context_line":"                pci_requests.distinct_tags \u003d ["},{"line_number":221,"context_line":"                    s.strip() for s in tags.split(\u0027,\u0027)]"},{"line_number":222,"context_line":"            # NOTE(jaypipes): ComputeNode.pci_device_pools is set below"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_1e0f1be2","line":219,"range":{"start_line":219,"start_character":56,"end_line":219,"end_character":73},"in_reply_to":"1f1a1f67_47f5e7ca","updated":"2017-07-13 13:22:34.000000000","message":"Probably I need to update the spec, I decided to use a flavor property for that.","commit_id":"6037963e2cfc7bd85023beff05365f2672eabbc8"},{"author":{"_account_id":25588,"name":"Maciej Kucia","email":"maciej@kucia.net","username":"m.kucia"},"change_message_id":"d7494c0b11e0d9771bbb049cfdd2b7b7a2ad4b58","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            if pci_requests:"},{"line_number":219,"context_line":"                tags \u003d instance.flavor.extra_specs.get(\u0027pci_distinct_tags\u0027, \u0027\u0027)"},{"line_number":220,"context_line":"                pci_requests.distinct_tags \u003d ["},{"line_number":221,"context_line":"                    s.strip() for s in tags.split(\u0027,\u0027)]"},{"line_number":222,"context_line":"            # NOTE(jaypipes): ComputeNode.pci_device_pools is set below"},{"line_number":223,"context_line":"            # in _update_usage_from_instance()."},{"line_number":224,"context_line":"            self.pci_tracker.claim_instance(context, pci_requests,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_7c61ad39","line":221,"range":{"start_line":221,"start_character":20,"end_line":221,"end_character":29},"updated":"2017-07-12 09:42:04.000000000","message":"I think tags should be case insensitive.","commit_id":"6037963e2cfc7bd85023beff05365f2672eabbc8"},{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"3151f93da017c74be92708c5017b1f51ab6cc7fa","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            if pci_requests:"},{"line_number":219,"context_line":"                tags \u003d instance.flavor.extra_specs.get(\u0027pci_distinct_tags\u0027, \u0027\u0027)"},{"line_number":220,"context_line":"                pci_requests.distinct_tags \u003d ["},{"line_number":221,"context_line":"                    s.strip() for s in tags.split(\u0027,\u0027)]"},{"line_number":222,"context_line":"            # NOTE(jaypipes): ComputeNode.pci_device_pools is set below"},{"line_number":223,"context_line":"            # in _update_usage_from_instance()."},{"line_number":224,"context_line":"            self.pci_tracker.claim_instance(context, pci_requests,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_650a0927","line":221,"range":{"start_line":221,"start_character":20,"end_line":221,"end_character":29},"in_reply_to":"1f1a1f67_7c61ad39","updated":"2017-07-13 13:22:34.000000000","message":"agreed, will fix.","commit_id":"6037963e2cfc7bd85023beff05365f2672eabbc8"}],"nova/pci/stats.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"cacbb613c85f168306e991207ab3767a5990f626","unresolved":false,"context_lines":[{"line_number":316,"context_line":"                    matched_pools.append(matched_pool)"},{"line_number":317,"context_line":"        i \u003d 0"},{"line_number":318,"context_line":"        for pool_list in itertools.combinations(matched_pools, len(specs)):"},{"line_number":319,"context_line":"            # the number of steps for selecting distinct tag values"},{"line_number":320,"context_line":"            # is p!/(r! * (p - r)!), the following limit is up to 3 requests"},{"line_number":321,"context_line":"            # from 100 pci pools or 4 from 25 pools"},{"line_number":322,"context_line":"            if i \u003e 5e6:"},{"line_number":323,"context_line":"                LOG.debug(\u0027Cannot calculate distinct tag values \u0027"},{"line_number":324,"context_line":"                          \u0027due a large number of requests and pools\u0027)"},{"line_number":325,"context_line":"                return"},{"line_number":326,"context_line":"            if self._check_distinct_tag_values(pool_list):"},{"line_number":327,"context_line":"                LOG.debug((\u0027Distinct tag values for pci requests were found, \u0027"},{"line_number":328,"context_line":"                           \u0027pci requests are updated %s\u0027), pool_list)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_677d831b","line":325,"range":{"start_line":319,"start_character":0,"end_line":325,"end_character":22},"updated":"2017-07-12 20:45:30.000000000","message":"This seems arbitrary.  If it\u0027s going to be done at all, I would think the limit should be configurable.","commit_id":"6037963e2cfc7bd85023beff05365f2672eabbc8"},{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"3151f93da017c74be92708c5017b1f51ab6cc7fa","unresolved":false,"context_lines":[{"line_number":316,"context_line":"                    matched_pools.append(matched_pool)"},{"line_number":317,"context_line":"        i \u003d 0"},{"line_number":318,"context_line":"        for pool_list in itertools.combinations(matched_pools, len(specs)):"},{"line_number":319,"context_line":"            # the number of steps for selecting distinct tag values"},{"line_number":320,"context_line":"            # is p!/(r! * (p - r)!), the following limit is up to 3 requests"},{"line_number":321,"context_line":"            # from 100 pci pools or 4 from 25 pools"},{"line_number":322,"context_line":"            if i \u003e 5e6:"},{"line_number":323,"context_line":"                LOG.debug(\u0027Cannot calculate distinct tag values \u0027"},{"line_number":324,"context_line":"                          \u0027due a large number of requests and pools\u0027)"},{"line_number":325,"context_line":"                return"},{"line_number":326,"context_line":"            if self._check_distinct_tag_values(pool_list):"},{"line_number":327,"context_line":"                LOG.debug((\u0027Distinct tag values for pci requests were found, \u0027"},{"line_number":328,"context_line":"                           \u0027pci requests are updated %s\u0027), pool_list)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_7ec60f6a","line":325,"range":{"start_line":319,"start_character":0,"end_line":325,"end_character":22},"in_reply_to":"1f1a1f67_677d831b","updated":"2017-07-13 13:22:34.000000000","message":"Yeah, most controversial part, but the idea was to do the best to get pci devices and still not to take too much time.\nAgree that it should be configurable at least.","commit_id":"6037963e2cfc7bd85023beff05365f2672eabbc8"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"cacbb613c85f168306e991207ab3767a5990f626","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                LOG.debug(\u0027Cannot calculate distinct tag values \u0027"},{"line_number":324,"context_line":"                          \u0027due a large number of requests and pools\u0027)"},{"line_number":325,"context_line":"                return"},{"line_number":326,"context_line":"            if self._check_distinct_tag_values(pool_list):"},{"line_number":327,"context_line":"                LOG.debug((\u0027Distinct tag values for pci requests were found, \u0027"},{"line_number":328,"context_line":"                           \u0027pci requests are updated %s\u0027), pool_list)"},{"line_number":329,"context_line":"                for pool in pool_list:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_87ebffae","line":326,"range":{"start_line":326,"start_character":12,"end_line":326,"end_character":58},"updated":"2017-07-12 20:45:30.000000000","message":"As mentioned in the spec, I think we should fail (possibly at the behest of a \"strict\" option in the flavor?) if we can\u0027t do the tag spread.","commit_id":"6037963e2cfc7bd85023beff05365f2672eabbc8"},{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"3151f93da017c74be92708c5017b1f51ab6cc7fa","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                LOG.debug(\u0027Cannot calculate distinct tag values \u0027"},{"line_number":324,"context_line":"                          \u0027due a large number of requests and pools\u0027)"},{"line_number":325,"context_line":"                return"},{"line_number":326,"context_line":"            if self._check_distinct_tag_values(pool_list):"},{"line_number":327,"context_line":"                LOG.debug((\u0027Distinct tag values for pci requests were found, \u0027"},{"line_number":328,"context_line":"                           \u0027pci requests are updated %s\u0027), pool_list)"},{"line_number":329,"context_line":"                for pool in pool_list:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_5e8a331b","line":326,"range":{"start_line":326,"start_character":12,"end_line":326,"end_character":58},"in_reply_to":"1f1a1f67_87ebffae","updated":"2017-07-13 13:22:34.000000000","message":"Yes, good idea.","commit_id":"6037963e2cfc7bd85023beff05365f2672eabbc8"},{"author":{"_account_id":25588,"name":"Maciej Kucia","email":"maciej@kucia.net","username":"m.kucia"},"change_message_id":"d7494c0b11e0d9771bbb049cfdd2b7b7a2ad4b58","unresolved":false,"context_lines":[{"line_number":331,"context_line":"                    del pool[\u0027spec\u0027]"},{"line_number":332,"context_line":"                    specs[spec_num].update(pool)"},{"line_number":333,"context_line":"                break"},{"line_number":334,"context_line":"            i +\u003d 1"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"    def apply_requests(self, requests, numa_cells\u003dNone):"},{"line_number":337,"context_line":"        \"\"\"Apply PCI requests to the PCI stats."}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_87831657","line":334,"updated":"2017-07-12 09:42:04.000000000","message":"This all looks quite complex for the task.\nI think this problem would be solved better using SQL (see this fiddle stolen from Stackoverflow: http://sqlfiddle.com/#!9/27201/1)\nA new table pci_devices_tags would be required though.","commit_id":"6037963e2cfc7bd85023beff05365f2672eabbc8"},{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"3151f93da017c74be92708c5017b1f51ab6cc7fa","unresolved":false,"context_lines":[{"line_number":331,"context_line":"                    del pool[\u0027spec\u0027]"},{"line_number":332,"context_line":"                    specs[spec_num].update(pool)"},{"line_number":333,"context_line":"                break"},{"line_number":334,"context_line":"            i +\u003d 1"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"    def apply_requests(self, requests, numa_cells\u003dNone):"},{"line_number":337,"context_line":"        \"\"\"Apply PCI requests to the PCI stats."}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_9ebfabfa","line":334,"in_reply_to":"1f1a1f67_8712dfb0","updated":"2017-07-13 13:22:34.000000000","message":"My first proposal was quite similar to what Maciej suggested,\nbut here is the problem: each pci request may have an own spec which matches pci pools\nand there is no guaranty that the matched pools are the same for both pci requests.\nThis patch tries to solve the following problem: we have pci requests with arbitrary spec\nwhich cat split a pci device set on some subsets, after that we need to pick devices \nfor those subsets honoring condition they have distinct tags.\nWith the \"group by\" approach, it\u0027s not clear on what fields I should make group by and\nhow it helps to update pci requests.\nAnyway, if you have an idea how it can be made in a more clean way I would happy to implement it.","commit_id":"6037963e2cfc7bd85023beff05365f2672eabbc8"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"cacbb613c85f168306e991207ab3767a5990f626","unresolved":false,"context_lines":[{"line_number":331,"context_line":"                    del pool[\u0027spec\u0027]"},{"line_number":332,"context_line":"                    specs[spec_num].update(pool)"},{"line_number":333,"context_line":"                break"},{"line_number":334,"context_line":"            i +\u003d 1"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"    def apply_requests(self, requests, numa_cells\u003dNone):"},{"line_number":337,"context_line":"        \"\"\"Apply PCI requests to the PCI stats."}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_8712dfb0","line":334,"in_reply_to":"1f1a1f67_87831657","updated":"2017-07-12 20:45:30.000000000","message":"Which would require nailing down the tags at impl time, thereby removing their ability to be arbitrary, with all the benefits thereof.  Or creating tables on the fly, which sounds uck.\n\nThough I do agree this looks way complex.  It\u0027s tough to read, and will be a bear to debug.","commit_id":"6037963e2cfc7bd85023beff05365f2672eabbc8"}],"nova/tests/unit/pci/test_stats.py":[{"author":{"_account_id":25588,"name":"Maciej Kucia","email":"maciej@kucia.net","username":"m.kucia"},"change_message_id":"d7494c0b11e0d9771bbb049cfdd2b7b7a2ad4b58","unresolved":false,"context_lines":[{"line_number":446,"context_line":"                            spec\u003d[{\u0027product_id\u0027: \u00271515\u0027}])]"},{"line_number":447,"context_line":"        self.assertIsNone(self.pci_stats.consume_requests(pci_requests))"},{"line_number":448,"context_line":""},{"line_number":449,"context_line":""},{"line_number":450,"context_line":"class PciDeviceStatsAddDistinctTagValuesTestCase(test.NoDBTestCase):"},{"line_number":451,"context_line":"    @mock.patch.object(whitelist.Whitelist, \u0027get_devspec\u0027)"},{"line_number":452,"context_line":"    def _generate(self, pools, requests, get_devspec):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_e793eaa2","line":449,"updated":"2017-07-12 09:42:04.000000000","message":"Some test should cover tags upper-lower case matching.","commit_id":"6037963e2cfc7bd85023beff05365f2672eabbc8"},{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"3151f93da017c74be92708c5017b1f51ab6cc7fa","unresolved":false,"context_lines":[{"line_number":446,"context_line":"                            spec\u003d[{\u0027product_id\u0027: \u00271515\u0027}])]"},{"line_number":447,"context_line":"        self.assertIsNone(self.pci_stats.consume_requests(pci_requests))"},{"line_number":448,"context_line":""},{"line_number":449,"context_line":""},{"line_number":450,"context_line":"class PciDeviceStatsAddDistinctTagValuesTestCase(test.NoDBTestCase):"},{"line_number":451,"context_line":"    @mock.patch.object(whitelist.Whitelist, \u0027get_devspec\u0027)"},{"line_number":452,"context_line":"    def _generate(self, pools, requests, get_devspec):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_1e415b0c","line":449,"in_reply_to":"1f1a1f67_e793eaa2","updated":"2017-07-13 13:22:34.000000000","message":"Sure.","commit_id":"6037963e2cfc7bd85023beff05365f2672eabbc8"}]}
