Undesired migrate repository path caching.

Bug #1259229 reported by Ilya Pekelny
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Ilya Pekelny
oslo-incubator
Fix Released
Undecided
Ilya Pekelny

Bug Description

Oslo.db migration.py uses singleton to store defined `migrate.versioning.repository.Repository` instance containing migration repository path. Most of plugins have its own migrate repo. Usage of singleton in point of Repository instances causes implicit and unexpected behavior therefore as current Repository instance may contain inappropriate path to migrate repo.

Solution: do not use singleton.

Ilya Pekelny (i159)
affects: oslo → keystone
affects: keystone → oslo
Changed in oslo:
assignee: nobody → Ilya Pekelny (i159)
Changed in keystone:
assignee: nobody → Ilya Pekelny (i159)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo-incubator (master)

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

Changed in oslo:
status: New → In Progress
Revision history for this message
Dolph Mathews (dolph) wrote :

How do you reproduce this as a bug? What's the failure?

Changed in keystone:
status: New → Incomplete
Revision history for this message
Ilya Pekelny (i159) wrote :

Hello, Dolph! I reproduced the bug during the syncing keystone with `openstack/common/db/sqlalchemy/migration.py`.
The failure is:

    AppError: Bad response: 500 Internal Server Error (not 200 OK or 3xx redirect for http://localhost/v3/OS- OAUTH1/consumers/OS-OAUTH1/consumers/OS-OAUTH1/consumers)
    '{"error": {"message": "An unexpected error prevented the server from fulfilling your request. (OperationalError) no such table: consumer u\'INSERT INTO consumer (id, description, secret, extra) VALUES (?, ?, ?, ?)\' (\'0cb09dea1f1046f9b4dc47d0c9a16ad9\', u\'c14c2d8c71444abc8821a676b0d97036\', \'6ff135b84a9a4c089d4fac4179875e35\', \'{}\')", "code": 500, "title": "Internal Server Error"}}'

There is no expected tables because the wrong migrate repo path was used for migrations. I amended the bug report. Now the cause described well, I hope. Feel free to ask.

Revision history for this message
Dolph Mathews (dolph) wrote :

Thanks!

Changed in keystone:
status: Incomplete → Triaged
importance: Undecided → High
importance: High → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo-incubator (master)

Reviewed: https://review.openstack.org/60877
Committed: https://git.openstack.org/cgit/openstack/oslo-incubator/commit/?id=855644a7e9b850238bc69b35c990a5d82ab48f7e
Submitter: Jenkins
Branch: master

commit 855644a7e9b850238bc69b35c990a5d82ab48f7e
Author: Ilya Pekelny <email address hidden>
Date: Mon Dec 9 19:05:23 2013 +0200

    Removal of _REPOSITORY global variable.

    Oslo.db migration.py uses global variable to store defined
    `migrate.versioning.repository.Repository` instance containing migration
    repository path. At first _find_migrate_repo(repo_path) call the return value
    will be stored in a global variable. So all subsequent calls
    will return the existing global variable value regardless of repo_path
    value passed. This design makes impossible to have multiple migration
    repositories in the same project.
    Detected at syncing of Keystone with Oslo.db.

    Change-Id: If6187a0f7c4590e1c2cd4d998b25ee90aeac17dc
    Closes-Bug: #1259229

Changed in oslo:
status: In Progress → Fix Committed
Changed in oslo:
milestone: none → icehouse-2
Thierry Carrez (ttx)
Changed in oslo:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in oslo:
milestone: icehouse-2 → 2014.1
Revision history for this message
Steve Martinelli (stevemar) wrote :

We no longer have extension specific migrations for reasons just like this. We've collapsed all the extensions into keystone proper and run them all by default. Marking this as fix released.

Changed in keystone:
status: Triaged → Fix Released
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.