Squash the havana migration scripts

Bug #1420103 reported by Kanagaraj Manickam
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Low
Qiming Teng

Bug Description

Once heat is installed, admin runs "heat-manage db_sync" command, which will run all migration scripts (in ./heat/db/sqlalchemy/migrate_repo/versions) upto HEAD version. This is very much suitable for the upgrades/downgrades of heat versions.
But on the fresh installation, the db schema can be created directly in sqlalchemy way, instead of running through these migration scripts, which will speedup the operation and schema will be generated in single run.

This bug is filed to address it.

To fix, we could use following snippet of the code:

from sqlalchemy.ext.declarative import declarative_base
#engine = <create the engine here>
declarative_base().metadata.create_all(engine).
#stamp with head version

Changed in heat:
assignee: nobody → Kanagaraj Manickam (kanagaraj-manickam)
description: updated
description: updated
Revision history for this message
Angus Salkeld (asalkeld) wrote :

How much time does that really save?
It seems like an unnecessary optimisation to me
Also don't the migrations save the current migration in the db?
So doing what you suggest will break that?

Revision history for this message
Kanagaraj Manickam (kanagaraj-manickam) wrote :

As you have suggested over IRC, we could go with squash concept here to reduce the number of migrations to be within the range of versions from 'icehouse' as sated in https://wiki.openstack.org/wiki/Releases.

 we could use this bug to squash.

Revision history for this message
Angus Salkeld (asalkeld) wrote :

Let's find out what the process is for this.

1. how many can we do? havana/icehouse...
2. we probably need to leave placeholder scripts in place.
3. etc... - let's learn from other people/project's experience.

summary: - on fresh installation, create schema directly instead of migration
- scripts
+ Squash the havana migration scripts
Changed in heat:
status: New → Triaged
importance: Undecided → Low
milestone: none → liberty-1
Revision history for this message
Sergey Kraynev (skraynev) wrote :

FYI: I have it with guys from nova. As feedback:
- it does not get huge benefit for us in performance
- we can get some errors/mistakes due to it's manual work (there is no any automatic script)
- it makes migrate history less clear (honestly, it's not big deal)
So I agree with Low status, and it can be done by anybody, who wants contribute to Heat.
Some advises can be gotten from dprince (he did the same thing in nova).
btw glance and cinder do not worry about this work.

Changed in heat:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Changed in heat:
assignee: Kanagaraj Manickam (kanagaraj-manickam) → Qiming Teng (tengqim)
Revision history for this message
Kanagaraj Manickam (kanagaraj-manickam) wrote :

Hi Qming, I was working on this as it got scheduled for Liberty-1 and i mentioned it in etherpad (https://etherpad.openstack.org/p/YVR-heat-contributor-meetup) as well.

Now, you have submitted an patch for it.
So, I'm concerned here that I lost the effort I had spent on this defect. And I would have been happy
if you have tried to let me know, before you start to work on it, which would effectively saved your effort as well !

Revision history for this message
Qiming Teng (tengqim) wrote :

Oh, Kanagaraj Manickam, I didn't realize that you were working on it when I signed up for this back in Vancouver.
Sorry for the conflicts caused.

Changed in heat:
milestone: liberty-1 → liberty-2
Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-2 → 5.0.0
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.