Migration 020 incorrectly assigns roles.

Bug #1186128 reported by Jamie Lennox
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Critical
Jamie Lennox
Grizzly
Fix Released
Critical
Dolph Mathews

Bug Description

This is showing up intermitantly in MySQL tests with SQL upgrades. A query in migration 020 is incorrectly formed and results in updating all of a user's roles rather than just that assigned to a project.

On the current master:
https://github.com/openstack/keystone/blob/50be064b9243182799ce6544d169f414594d628b/keystone/common/sql/migrate_repo/versions/020_migrate_metadata_table_roles.py#L44

the query:

    q = new_metadata_table.update().where(
            new_metadata_table.c.user_id == metadata.user_id and
            new_metadata_table.c.project_id == metadata.tenant_id).values(
                data=json.dumps(data))

produces the statement:

    UPDATE user_project_metadata SET data=%s WHERE user_project_metadata.user_id = %s

rather than the obviously intended:

    UPDATE user_project_metadata SET data=%s WHERE user_project_metadata.user_id = %s AND user_project_metadata.project_id = %s

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/31162

Changed in keystone:
assignee: nobody → Jamie Lennox (jamielennox)
status: New → In Progress
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Critical
tags: added: grizzly-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/31162
Committed: http://github.com/openstack/keystone/commit/87dd116aea6e3c8d9d436ce6b5bf1fbbe0ff0788
Submitter: Jenkins
Branch: master

commit 87dd116aea6e3c8d9d436ce6b5bf1fbbe0ff0788
Author: Jamie Lennox <email address hidden>
Date: Fri May 31 15:46:01 2013 +1000

    Fix incorrect role assignment in migration.

    In the case where a user has existing roles on a project running the
    migration would assign those same roles to all the user's projects.

    Change-Id: Ibd99bb7cf6cb84b577eca57f903abf9d48e908c1
    Fixes: bug 1186128

Changed in keystone:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (stable/grizzly)

Fix proposed to branch: stable/grizzly
Review: https://review.openstack.org/31793

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (stable/grizzly)

Reviewed: https://review.openstack.org/31793
Committed: http://github.com/openstack/keystone/commit/8dd57da1460134461c8cdf75e5cf653b7a84027f
Submitter: Jenkins
Branch: stable/grizzly

commit 8dd57da1460134461c8cdf75e5cf653b7a84027f
Author: Jamie Lennox <email address hidden>
Date: Fri May 31 15:46:01 2013 +1000

    Fix incorrect role assignment in migration.

    In the case where a user has existing roles on a project running the
    migration would assign those same roles to all the user's projects.

    Change-Id: Ibd99bb7cf6cb84b577eca57f903abf9d48e908c1
    Fixes: bug 1186128

tags: removed: grizzly-backport-potential
Thierry Carrez (ttx)
Changed in keystone:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: havana-2 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.