← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1648529] Re: additional project_id in sql query

 

** Changed in: neutron
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1648529

Title:
  additional project_id in sql query

Status in neutron:
  Invalid

Bug description:
  Hello

  When fetching record of default security group, the following issue discovered:
  SQL query has 2 times project_id (same value).

  In MySQL log I see the following query:

  2016-12-08T11:31:38.910379Z      1301 Query     SELECT default_security_group.project_id AS default_security_group_project_id, default_security_group.security_group_id AS default_security_group_security_group_id, standardattributes_1.id AS standardattributes_1_id, standardattributes_1.resource_type AS standardattributes_1_resource_type, standardattributes_1.description AS standardattributes_1_description, standardattributes_1.revision_number AS standardattributes_1_revision_number, standardattributes_1.created_at AS standardattributes_1_created_at, standardattributes_1.updated_at AS standardattributes_1_updated_at, tags_1.standard_attr_id AS tags_1_standard_attr_id, tags_1.tag AS tags_1_tag, securitygroups_1.project_id AS securitygroups_1_project_id, securitygroups_1.id AS securitygroups_1_id, securitygroups_1.name AS securitygroups_1_name, securitygroups_1.standard_attr_id AS securitygroups_1_standard_attr_id, standardattributes_2.id AS standardattributes_2_id, standardattributes_2.resource_type AS standardattributes_2_resource_type, standardattributes_2.description AS standardattributes_2_description, standardattributes_2.revision_number AS standardattributes_2_revision_number, standardattributes_2.created_at AS standardattributes_2_created_at, standardattributes_2.updated_at AS standardattributes_2_updated_at, tags_2.standard_attr_id AS tags_2_standard_attr_id, tags_2.tag AS tags_2_tag, securitygrouprules_1.project_id AS securitygrouprules_1_project_id, securitygrouprules_1.id AS securitygrouprules_1_id, securitygrouprules_1.security_group_id AS securitygrouprules_1_security_group_id, securitygrouprules_1.remote_group_id AS securitygrouprules_1_remote_group_id, securitygrouprules_1.direction AS securitygrouprules_1_direction, securitygrouprules_1.ethertype AS securitygrouprules_1_ethertype, securitygrouprules_1.protocol AS securitygrouprules_1_protocol, securitygrouprules_1.port_range_min AS securitygrouprules_1_port_range_min, securitygrouprules_1.port_range_max AS securitygrouprules_1_port_range_max, securitygrouprules_1.remote_ip_prefix AS securitygrouprules_1_remote_ip_prefix, securitygrouprules_1.standard_attr_id AS securitygrouprules_1_standard_attr_id 
  FROM default_security_group LEFT OUTER JOIN securitygroups AS securitygroups_1 ON securitygroups_1.id = default_security_group.security_group_id LEFT OUTER JOIN standardattributes AS standardattributes_1 ON standardattributes_1.id = securitygroups_1.standard_attr_id LEFT OUTER JOIN tags AS tags_1 ON standardattributes_1.id = tags_1.standard_attr_id LEFT OUTER JOIN securitygrouprules AS securitygrouprules_1 ON securitygroups_1.id = securitygrouprules_1.security_group_id LEFT OUTER JOIN standardattributes AS standardattributes_2 ON standardattributes_2.id = securitygrouprules_1.standard_attr_id LEFT OUTER JOIN tags AS tags_2 ON standardattributes_2.id = tags_2.standard_attr_id 

  WHERE default_security_group.project_id =
  'cf94b55927aa4ed78baa6b88cda55a47' AND
  default_security_group.project_id = 'cf94b55927aa4ed78baa6b88cda55a47'

  How to reproduce:
  1. Run in MySQL shell:
  SET GLOBAL general_log='ON';
  2. Create a network ( I am running rally tests for it)

  This code is called from the following file:
  neutron/db/securitygroups_db.py
  _ensure_default_security_group()

              query = self._model_query(context, sg_models.DefaultSecurityGroup)
              default_group = query.filter_by(tenant_id=tenant_id).one()
              return default_group['security_group_id']

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1648529/+subscriptions


References