)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"00416a3ee87b02769b4bb3dcc6c8271a646e6a98","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix subnet service types query for sqlite3 3.7.17"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"_query_filter_service_subnets is returning unexpected query with"},{"line_number":10,"context_line":"sqlite 3.7.15 - 3.7.17 versions(but working as expected for other"},{"line_number":11,"context_line":"sqlite versions) causing \"test_subnet_service_types\" unit test failures."},{"line_number":12,"context_line":"If the query is modified like in this change, it is working as"},{"line_number":13,"context_line":"expected on all sqlite versions."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa6399be_7a34eedd","line":10,"updated":"2016-10-11 01:32:43.000000000","message":"nit: missing whitespace","commit_id":"aeb85e48d5f47660b83853125c747cf40b75c8b5"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f2010e1039dd8f2726f1ebaf2e9b1bc71f9d2781","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix subnet service types query for sqlite3 3.7.17"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"_query_filter_service_subnets is returning unexpected query with"},{"line_number":10,"context_line":"sqlite 3.7.15 - 3.7.17 versions(but working as expected for other"},{"line_number":11,"context_line":"sqlite versions) causing \"test_subnet_service_types\" unit test failures."},{"line_number":12,"context_line":"If the query is modified like in this change, it is working as"},{"line_number":13,"context_line":"expected on all sqlite versions."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"ba5201f7_2ac33e58","line":10,"in_reply_to":"fa6399be_7a34eedd","updated":"2017-01-06 19:43:19.000000000","message":"Done","commit_id":"aeb85e48d5f47660b83853125c747cf40b75c8b5"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"81c3180e82701b008415490c09ec1c8bfe21165b","unresolved":false,"context_lines":[{"line_number":9,"context_line":"_query_filter_service_subnets is returning unexpected query with"},{"line_number":10,"context_line":"sqlite 3.7.15 - 3.7.17 versions(but working as expected for other"},{"line_number":11,"context_line":"sqlite versions) causing \"test_subnet_service_types\" unit test failures."},{"line_number":12,"context_line":"If the query is modified like in this change, it is working as"},{"line_number":13,"context_line":"expected on all sqlite versions."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Closes-bug: #1628996"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3a98d1f4_cc4cffca","line":12,"updated":"2016-09-30 10:43:51.000000000","message":"Lets say clearly how it was modified. I would also put a note in devref[1] that such queries do not work for some sqlite versions.\n\n[1] - http://docs.openstack.org/developer/neutron/devref/effective_neutron.html#database-interaction","commit_id":"aeb85e48d5f47660b83853125c747cf40b75c8b5"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"e67410f6316f591d8c0ce156d2e1cdaa44684f1c","unresolved":false,"context_lines":[{"line_number":9,"context_line":"_query_filter_service_subnets is returning unexpected query with"},{"line_number":10,"context_line":"sqlite 3.7.15 - 3.7.17 versions(but working as expected for other"},{"line_number":11,"context_line":"sqlite versions) causing \"test_subnet_service_types\" unit test failures."},{"line_number":12,"context_line":"If the query is modified like in this change, it is working as"},{"line_number":13,"context_line":"expected on all sqlite versions."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Closes-bug: #1628996"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3a98d1f4_90fe68ac","line":12,"in_reply_to":"3a98d1f4_cc4cffca","updated":"2016-09-30 19:36:22.000000000","message":"Thanks Ann.\nSure. I suspect ORDER BY(when no records in the table) with LEFT OUTER JOIN in query [1]\n \nWhen I remove ORDER BY in that test program, the result(i.e no records) is same in 3.7.17 and 3.8.0\n\n[1] https://bugs.launchpad.net/neutron/+bug/1628996/comments/3","commit_id":"aeb85e48d5f47660b83853125c747cf40b75c8b5"}],"neutron/db/ipam_backend_mixin.py":[{"author":{"_account_id":6635,"name":"John Davidge","email":"john.davidge@rackspace.com","username":"john-davidge"},"change_message_id":"c12b0c7bd0397093d9b0fe95239b375b228f95e2","unresolved":false,"context_lines":[{"line_number":595,"context_line":"        return query.filter(models_v2.Subnet.network_id \u003d\u003d network_id)"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"    def _query_filter_service_subnets(self, context, query, service_type):"},{"line_number":598,"context_line":"        ServiceType \u003d sst_model.SubnetServiceType"},{"line_number":599,"context_line":"        query1 \u003d query.join(ServiceType)"},{"line_number":600,"context_line":"        query1 \u003d query1.filter(ServiceType.service_type \u003d\u003d service_type)"},{"line_number":601,"context_line":"        query2 \u003d query.filter(models_v2.Subnet.id.notin_("},{"line_number":602,"context_line":"            context.session.query(ServiceType.subnet_id)))"},{"line_number":603,"context_line":"        return query1.union(query2)"},{"line_number":604,"context_line":""},{"line_number":605,"context_line":"    @staticmethod"},{"line_number":606,"context_line":"    def _query_filter_by_segment_host_mapping(query, host):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a98d1f4_12eb5c14","line":603,"range":{"start_line":598,"start_character":8,"end_line":603,"end_character":35},"updated":"2016-09-30 11:06:24.000000000","message":"Which part specifically of the original query was causing the failures you saw? I agree with Ann\u0027s comment that a devref note would be great. Glad you tracked down the issue in your CI!","commit_id":"aeb85e48d5f47660b83853125c747cf40b75c8b5"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"cc775dd1e5422e5002a389295ca71b2d2dd9e105","unresolved":false,"context_lines":[{"line_number":595,"context_line":"        return query.filter(models_v2.Subnet.network_id \u003d\u003d network_id)"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"    def _query_filter_service_subnets(self, context, query, service_type):"},{"line_number":598,"context_line":"        ServiceType \u003d sst_model.SubnetServiceType"},{"line_number":599,"context_line":"        query1 \u003d query.join(ServiceType)"},{"line_number":600,"context_line":"        query1 \u003d query1.filter(ServiceType.service_type \u003d\u003d service_type)"},{"line_number":601,"context_line":"        query2 \u003d query.filter(models_v2.Subnet.id.notin_("},{"line_number":602,"context_line":"            context.session.query(ServiceType.subnet_id)))"},{"line_number":603,"context_line":"        return query1.union(query2)"},{"line_number":604,"context_line":""},{"line_number":605,"context_line":"    @staticmethod"},{"line_number":606,"context_line":"    def _query_filter_by_segment_host_mapping(query, host):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a98d1f4_7d97083a","line":603,"range":{"start_line":598,"start_character":8,"end_line":603,"end_character":35},"in_reply_to":"3a98d1f4_12eb5c14","updated":"2016-09-30 13:54:35.000000000","message":"My only concern is the performance implication - is there any?  I know Carl and John worked hard on that.","commit_id":"aeb85e48d5f47660b83853125c747cf40b75c8b5"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"e67410f6316f591d8c0ce156d2e1cdaa44684f1c","unresolved":false,"context_lines":[{"line_number":595,"context_line":"        return query.filter(models_v2.Subnet.network_id \u003d\u003d network_id)"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"    def _query_filter_service_subnets(self, context, query, service_type):"},{"line_number":598,"context_line":"        ServiceType \u003d sst_model.SubnetServiceType"},{"line_number":599,"context_line":"        query1 \u003d query.join(ServiceType)"},{"line_number":600,"context_line":"        query1 \u003d query1.filter(ServiceType.service_type \u003d\u003d service_type)"},{"line_number":601,"context_line":"        query2 \u003d query.filter(models_v2.Subnet.id.notin_("},{"line_number":602,"context_line":"            context.session.query(ServiceType.subnet_id)))"},{"line_number":603,"context_line":"        return query1.union(query2)"},{"line_number":604,"context_line":""},{"line_number":605,"context_line":"    @staticmethod"},{"line_number":606,"context_line":"    def _query_filter_by_segment_host_mapping(query, host):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a98d1f4_90ed88b9","line":603,"range":{"start_line":598,"start_character":8,"end_line":603,"end_character":35},"in_reply_to":"3a98d1f4_12eb5c14","updated":"2016-09-30 19:36:22.000000000","message":"Thanks John. As explained in [1], the below query\n\nquery \u003d query.add_entity(ServiceType)\nquery \u003d query.outerjoin(ServiceType)\nquery \u003d query.filter(or_(ServiceType.service_type.is_(None),\n                         ServiceType.service_type \u003d\u003d service_type))\n\nis returning below record in sqlite 2.7.17 version(for UT test_create_port_no_device_owner_no_fallback)\n\n    (\u0027query \u003d \u0027, [(\u003cneutron.db.models_v2.Subnet[object at b807f50] {project_id\u003du\u002746f70361-ba71-4bd0-9769-3573fd227c4b\u0027, id\u003du\u00279968a941-0f30-4d95-98c7-5dfc8121f5ec\u0027, name\u003du\u0027\u0027, network_id\u003du\u0027b8612649-b288-4144-bd7b-45581ee6ee4c\u0027, segment_id\u003dNone, subnetpool_id\u003dNone, ip_version\u003d4, cidr\u003du\u002720.0.0.0/8\u0027, gateway_ip\u003du\u002720.0.0.1\u0027, enable_dhcp\u003dTrue, ipv6_ra_mode\u003dNone, ipv6_address_mode\u003dNone, standard_attr_id\u003d2}\u003e, None)])\n\n\nbut same query won\u0027t generate any records for sqlite 2.8.0 version(for same UT test_create_port_no_device_owner_no_fallback)\n\nPlease check my comments [1] and [2]. The issue can be reproducible with simple program in [2]\n\n[1] https://bugs.launchpad.net/neutron/+bug/1628996/comments/3\n[2] https://bugs.launchpad.net/neutron/+bug/1628996/comments/3","commit_id":"aeb85e48d5f47660b83853125c747cf40b75c8b5"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"e67410f6316f591d8c0ce156d2e1cdaa44684f1c","unresolved":false,"context_lines":[{"line_number":595,"context_line":"        return query.filter(models_v2.Subnet.network_id \u003d\u003d network_id)"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"    def _query_filter_service_subnets(self, context, query, service_type):"},{"line_number":598,"context_line":"        ServiceType \u003d sst_model.SubnetServiceType"},{"line_number":599,"context_line":"        query1 \u003d query.join(ServiceType)"},{"line_number":600,"context_line":"        query1 \u003d query1.filter(ServiceType.service_type \u003d\u003d service_type)"},{"line_number":601,"context_line":"        query2 \u003d query.filter(models_v2.Subnet.id.notin_("},{"line_number":602,"context_line":"            context.session.query(ServiceType.subnet_id)))"},{"line_number":603,"context_line":"        return query1.union(query2)"},{"line_number":604,"context_line":""},{"line_number":605,"context_line":"    @staticmethod"},{"line_number":606,"context_line":"    def _query_filter_by_segment_host_mapping(query, host):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a98d1f4_901bc8c9","line":603,"range":{"start_line":598,"start_character":8,"end_line":603,"end_character":35},"in_reply_to":"3a98d1f4_7d97083a","updated":"2016-09-30 19:36:22.000000000","message":"Thanks Brian. In modified code, we are still using single query. So I think there won\u0027t be any performance implication. But we will wait for Carl\u0027s answer.","commit_id":"aeb85e48d5f47660b83853125c747cf40b75c8b5"},{"author":{"_account_id":6635,"name":"John Davidge","email":"john.davidge@rackspace.com","username":"john-davidge"},"change_message_id":"737922e573d8c4bee020dbcb5333264a5b47945a","unresolved":false,"context_lines":[{"line_number":600,"context_line":"        query1 \u003d query.join(ServiceType)"},{"line_number":601,"context_line":"        query1 \u003d query1.filter(ServiceType.service_type \u003d\u003d service_type)"},{"line_number":602,"context_line":"        query2 \u003d query.filter(or_("},{"line_number":603,"context_line":"            models_v2.Subnet.id.notin_("},{"line_number":604,"context_line":"                context.session.query(ServiceType.subnet_id)),"},{"line_number":605,"context_line":"            # Allow DHCP ports to be created on subnets of any"},{"line_number":606,"context_line":"            # service type when DHCP is enabled on the subnet."},{"line_number":607,"context_line":"            and_(Subnet.enable_dhcp.is_(True),"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba5201f7_8ac926af","line":604,"range":{"start_line":603,"start_character":12,"end_line":604,"end_character":61},"updated":"2017-01-10 13:41:33.000000000","message":"If I\u0027m understanding this part correctly this is essentially checking each Subnet entry to see if its ID appears in the ServiceType table, which is exactly what we were tying to avoid by using two tables. I could be wrong, but it seems to me that this would be no different than if we had just added service_type as a new field in the Subnet table and used:\n\n\n  for subnet in subnets:\n    if subnet.service_type \u003d\u003d service_type:\n      # do something\n\n\nIt\u0027s my understanding that the performance implications of that are significantly worse than the current implementation, and so should be avoided if at all possible. I\u0027d be interested to hear from someone with better SQL-fu than mine to confirm/deny this.","commit_id":"3afc3b03baba372547707269ac48e7c72f4950d3"},{"author":{"_account_id":6635,"name":"John Davidge","email":"john.davidge@rackspace.com","username":"john-davidge"},"change_message_id":"737922e573d8c4bee020dbcb5333264a5b47945a","unresolved":false,"context_lines":[{"line_number":606,"context_line":"            # service type when DHCP is enabled on the subnet."},{"line_number":607,"context_line":"            and_(Subnet.enable_dhcp.is_(True),"},{"line_number":608,"context_line":"                 service_type \u003d\u003d const.DEVICE_OWNER_DHCP)))"},{"line_number":609,"context_line":"        return query1.union(query2)"},{"line_number":610,"context_line":""},{"line_number":611,"context_line":"    @staticmethod"},{"line_number":612,"context_line":"    def _query_filter_by_segment_host_mapping(query, host):"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba5201f7_efc64448","line":609,"range":{"start_line":609,"start_character":15,"end_line":609,"end_character":35},"updated":"2017-01-10 13:41:33.000000000","message":"This will return both the Subnet and ServiceType columns, when only the Subnet column is needed.","commit_id":"3afc3b03baba372547707269ac48e7c72f4950d3"}]}
